* src/GrampsDb/_GrampsDBCallback.py: sys.getfilesystemencoding()

* src/GrampsDb/_GrampsBSDDB.py: sys.getfilesystemencoding()
	* src/Exporter.py: sys.getfilesystemencoding()
	* src/ReportBase/_FileEntry.py: sys.getfilesystemencoding()
	* src/Editors/_EditMedia.py: sys.getfilesystemencoding()
	* src/DisplayTabs/_SourceEmbedList.py: sys.getfilesystemencoding()
	* src/plugins/WriteCD.py: sys.getfilesystemencoding()
	* src/plugins/WritePkg.py: sys.getfilesystemencoding()
	* src/plugins/Check.py: sys.getfilesystemencoding()
	* src/plugins/EventCmp.py: sys.getfilesystemencoding()
	* src/AddMedia.py: sys.getfilesystemencoding()
	* src/DisplayModels/_BaseModel.py: sys.getfilesystemencoding()
	* src/DateEdit.py: sys.getfilesystemencoding()
	* src/ArgHandler.py: sys.getfilesystemencoding()
	* src/DbLoader.py: sys.getfilesystemencoding()


svn: r7951
This commit is contained in:
Don Allingham 2007-01-22 03:56:23 +00:00
parent 9baee52474
commit 2406378435
16 changed files with 61 additions and 21 deletions

View File

@ -1,4 +1,19 @@
2007-01-21 Don Allingham <don@gramps-project.org>
* src/GrampsDb/_GrampsDBCallback.py: sys.getfilesystemencoding()
* src/GrampsDb/_GrampsBSDDB.py: sys.getfilesystemencoding()
* src/Exporter.py: sys.getfilesystemencoding()
* src/ReportBase/_FileEntry.py: sys.getfilesystemencoding()
* src/Editors/_EditMedia.py: sys.getfilesystemencoding()
* src/DisplayTabs/_SourceEmbedList.py: sys.getfilesystemencoding()
* src/plugins/WriteCD.py: sys.getfilesystemencoding()
* src/plugins/WritePkg.py: sys.getfilesystemencoding()
* src/plugins/Check.py: sys.getfilesystemencoding()
* src/plugins/EventCmp.py: sys.getfilesystemencoding()
* src/AddMedia.py: sys.getfilesystemencoding()
* src/DisplayModels/_BaseModel.py: sys.getfilesystemencoding()
* src/DateEdit.py: sys.getfilesystemencoding()
* src/ArgHandler.py: sys.getfilesystemencoding()
* src/DbLoader.py: sys.getfilesystemencoding()
* src/GrampsDb/_GrampsBSDDB.py: catch exceptions
* src/DisplayState.py: catch exceptions
* src/DbLoader.py: catch exceptions (DbLoader.read_file): catch exception

View File

@ -30,6 +30,7 @@ Provides the interface to allow a person to add a media object to the database.
#
#-------------------------------------------------------------------------
import os
import sys
#-------------------------------------------------------------------------
#
@ -130,7 +131,8 @@ class AddMediaObject(ManagedWindow.ManagedWindow):
mobj.set_handle(Utils.create_id())
mobj.set_mime_type(None)
else:
filename = self.file_text.get_filename()
filename = unicode(self.file_text.get_filename(),
sys.getfilesystemencoding())
full_file = filename
if self.relpath.get_active():
@ -173,7 +175,8 @@ class AddMediaObject(ManagedWindow.ManagedWindow):
see if the file exists. If it does, the imgae is loaded into
the preview window.
"""
filename = unicode(self.file_text.get_filename())
filename = unicode(self.file_text.get_filename(),
sys.getfilesystemencoding())
basename = os.path.basename(filename)
(root,ext) = os.path.splitext(basename)
old_title = unicode(self.description.get_text())

View File

@ -39,6 +39,7 @@ import gtk
#
#-------------------------------------------------------------------------
import os
import sys
import getopt
from gettext import gettext as _
@ -738,7 +739,8 @@ class NewNativeDbPrompter:
while (True):
response = choose.run()
if response == gtk.RESPONSE_OK:
filename = choose.get_filename()
filename = unicode(choose.get_filename(),
sys.getfilesystemencoding())
if filename == None:
continue
if os.path.splitext(filename)[1] != ".grdb":

View File

@ -68,7 +68,7 @@ import DateHandler
import const
import GrampsDisplay
import ManagedWindow
from Errors import MaskError, ValidationError
from Errors import ValidationError
#-------------------------------------------------------------------------
#

View File

@ -30,6 +30,7 @@ Handling of loading new/existing databases.
#
#-------------------------------------------------------------------------
import os
import sys
from bsddb.db import DBAccessError, DBRunRecoveryError, DBPageNotFoundError, DBInvalidArgError
from gettext import gettext as _
import logging
@ -98,7 +99,8 @@ class DbLoader:
choose.set_current_folder(get_default_dir())
response = choose.run()
if response == gtk.RESPONSE_OK:
filename = choose.get_filename()
filename = unicode(choose.get_filename(),
sys.getfilesystemencoding())
if self.check_errors(filename):
return ('','')
@ -147,7 +149,8 @@ class DbLoader:
while (True):
response = choose.run()
if response == gtk.RESPONSE_OK:
filename = choose.get_filename()
filename = unicode(choose.get_filename(),
sys.getfilesystemencoding())
if self.check_errors(filename):
return ('','')
@ -209,7 +212,8 @@ class DbLoader:
response = choose.run()
if response == gtk.RESPONSE_OK:
filename = choose.get_filename()
filename = unicode(choose.get_filename(),
sys.getfilesystemencoding())
if self.check_errors(filename):
return ('','')
@ -300,7 +304,8 @@ class DbLoader:
choose.set_current_folder(default_dir)
response = choose.run()
if response == gtk.RESPONSE_OK:
filename = choose.get_filename()
filename = unicode(choose.get_filename(),
sys.getfilesystemencoding())
if self.check_errors(filename):
return False

View File

@ -152,9 +152,10 @@ class BaseModel(gtk.GenericTreeModel):
def add_row_by_handle(self,handle):
self.rebuild_data()
index = self.indexlist[handle]
node = self.get_iter(index)
self.row_inserted(index, node)
index = self.indexlist.get(handle)
if index:
node = self.get_iter(index)
self.row_inserted(index, node)
def delete_row_by_handle(self,handle):
index = self.indexlist[handle]

View File

@ -34,7 +34,6 @@ from gettext import gettext as _
#-------------------------------------------------------------------------
import RelLib
import Errors
import Utils
from DdTargets import DdTargets
from _SourceRefModel import SourceRefModel
from _EmbeddedList import EmbeddedList

View File

@ -27,6 +27,7 @@
#-------------------------------------------------------------------------
from gettext import gettext as _
import os
import sys
#-------------------------------------------------------------------------
#
@ -216,7 +217,8 @@ class EditMedia(EditPrimary):
status = f.run()
if status == gtk.RESPONSE_OK:
self.file_path.set_text(f.get_filename())
self.file_path.set_text(unicode(f.get_filename(),
sys.getfilesystemencoding()))
f.destroy()
def setup_filepath(self):

View File

@ -28,6 +28,7 @@
#
#-------------------------------------------------------------------------
import os
import sys
from gettext import gettext as _
#-------------------------------------------------------------------------
@ -151,7 +152,8 @@ class Exporter:
the selected options (format, filename) and present the summary
of the proposed action.
"""
filename = self.chooser.get_filename()
filename = unicode(self.chooser.get_filename(),
sys.getfilesystemencoding())
name = os.path.split(filename)[1]
folder = os.path.split(filename)[0]
ix = self.get_selected_format_index()
@ -172,7 +174,8 @@ class Exporter:
Perform the actual Save As/Export operation.
Depending on the success status, set the text for the final page.
"""
filename = self.chooser.get_filename()
filename = unicode(self.chooser.get_filename(),
sys.getfilesystemencoding())
Config.set(Config.RECENT_EXPORT_DIR,os.path.split(filename)[0])
ix = self.get_selected_format_index()
self.pre_save()

View File

@ -34,7 +34,6 @@ import os
import shutil
import re
import time
import locale
from gettext import gettext as _
from bsddb import dbshelve, db
import logging

View File

@ -40,6 +40,7 @@ import os
import types
import traceback
import inspect
from gettext import gettext as _
from bsddb import db

View File

@ -21,6 +21,7 @@
# $Id$
import os
import sys
import gtk
class FileEntry(gtk.HBox):
@ -67,7 +68,8 @@ class FileEntry(gtk.HBox):
f.present()
status = f.run()
if status == gtk.RESPONSE_OK:
self.set_filename(f.get_filename())
self.set_filename(unicode(f.get_filename(),
sys.getfilesystemencoding()))
f.destroy()
def set_filename(self,path):

View File

@ -28,6 +28,7 @@
#
#-------------------------------------------------------------------------
import os
import sys
import cStringIO
try:
set()
@ -505,7 +506,8 @@ class CheckIntegrity:
self.bad_photo.append(ObjectId)
def fs_ok_clicked(obj):
name = fs_top.get_filename()
name = unicode(fs_top.get_filename(),
sys.getfilesystemencoding())
if os.path.isfile(name):
obj = self.db.get_object_from_handle(ObjectId)
obj.set_path(name)

View File

@ -28,6 +28,7 @@
#
#------------------------------------------------------------------------
import os
import sys
from gettext import gettext as _
#------------------------------------------------------------------------
@ -413,7 +414,8 @@ class DisplayChart(ManagedWindow.ManagedWindow):
f.set_current_folder(os.getcwd())
status = f.run()
name = unicode(f.get_filename())
name = unicode(f.get_filename(),
sys.getfilesystemencoding())
f.destroy()
if status == gtk.RESPONSE_OK:

View File

@ -28,6 +28,7 @@
#
#-------------------------------------------------------------------------
import os
import sys
from cStringIO import StringIO
from gettext import gettext as _
@ -234,7 +235,8 @@ class PackageWriter:
pass
def fs_ok_clicked(obj):
newfile = fs_top.get_filename()
newfile = unicode(fs_top.get_filename(),
sys.getfilesystemencoding())
if os.path.isfile(newfile):
self.copy_file(newfile,'burn:///%s/%s' % (base,obase))
ntype = Mime.get_type(newfile)

View File

@ -29,6 +29,7 @@
#-------------------------------------------------------------------------
import time
import os
import sys
import tarfile
from cStringIO import StringIO
from gettext import gettext as _
@ -139,7 +140,8 @@ class PackageWriter:
pass
def fs_ok_clicked(obj):
name = fs_top.get_filename()
name = unicode(fs_top.get_filename(),
sys.getfilesystemencoding())
if os.path.isfile(name):
archive.add(name)