ansel/utf8 encodings

svn: r1258
This commit is contained in:
Don Allingham
2003-01-19 06:25:20 +00:00
parent af7a07d49d
commit a9f8fe034f
15 changed files with 480 additions and 487 deletions

View File

@ -25,6 +25,7 @@
#-------------------------------------------------------------------------
import string
import os
from xml.parsers.expat import ExpatError
#-------------------------------------------------------------------------
#
@ -55,6 +56,7 @@ except:
#-------------------------------------------------------------------------
def importData(database, filename, callback):
filename = os.path.normpath(filename)
basefile = os.path.dirname(filename)
database.smap = {}
database.pmap = {}
@ -92,7 +94,11 @@ def importData(database, filename, callback):
import traceback
traceback.print_exc()
return 0
except ValueError,msg:
except ExpatError, msg:
ErrorDialog(_("Error reading %s") % filename + "\n" + \
_("The file is probably either corrupt or not a valid GRAMPS database.") + "\n" + str(msg))
return 0
except ValueError, msg:
if str(msg)[0:16] == "Incorrect length":
WarningDialog(_("Your database has encountered an error in the library "
"that compresses the data.\nYour data should be okay, but "