Error message for missing SAX parser

svn: r428
This commit is contained in:
Don Allingham 2001-09-25 14:41:02 +00:00
parent c951eb32e6
commit b3415b663a

View File

@ -49,9 +49,9 @@ except:
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
try: try:
from xml.sax import make_parser, SAXParseException from xml.sax import make_parser, SAXParseException, SAXReaderNotAvailable
except: except:
from _xmlplus.sax import make_parser, SAXParseException from _xmlplus.sax import make_parser, SAXParseException, SAXReaderNotAvailable
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -66,7 +66,14 @@ def importData(database, filename, callback):
database.pmap = {} database.pmap = {}
database.fmap = {} database.fmap = {}
parser = make_parser() try:
parser = make_parser()
except SAXReaderNotAvailable:
msg1 = _("GRAMPS is not able to find an XML parser on your system.")
msg2 = _("This is probably due to an incomplete python or PyXML installation")
GnomeErrorDialog("%s\n%s" % (msg1,msg2))
return
parser.setContentHandler(GrampsImportParser(database,callback,basefile)) parser.setContentHandler(GrampsImportParser(database,callback,basefile))
if gzip_ok: if gzip_ok: