diff --git a/src/EditSource.py b/src/EditSource.py index c6cd3d719..039e1e6c2 100644 --- a/src/EditSource.py +++ b/src/EditSource.py @@ -238,7 +238,7 @@ class DelSrcQuery: Utils.modified() for key in self.db.getPersonKeys(): - p = self.getPerson(key) + p = self.db.getPerson(key) for v in p.getEventList() + [p.getBirth(), p.getDeath()]: self.delete_source(v) diff --git a/src/EventEdit.py b/src/EventEdit.py index 9f1dd2bc3..7bc0c660e 100644 --- a/src/EventEdit.py +++ b/src/EventEdit.py @@ -50,7 +50,7 @@ _ = gettext # EventEditor class # #------------------------------------------------------------------------- -class EventEditor(Sources.SourceTab): +class EventEditor: def __init__(self,parent,name,list,trans,event,def_placename,read_only,cb): self.parent = parent diff --git a/src/Plugins.py b/src/Plugins.py index be220b7de..42e54f155 100644 --- a/src/Plugins.py +++ b/src/Plugins.py @@ -67,6 +67,7 @@ _imports = [] _exports = [] _success = [] _failed = [] +_expect = [] _attempt = [] _loaddir = [] _textdoc = [] @@ -74,6 +75,13 @@ _drawdoc = [] _failmsg = [] _unavailable = _("No description was provided"), +#------------------------------------------------------------------------- +# +# Exception Strings +# +#------------------------------------------------------------------------- +MissingLibraries = _("Missing Libraries") + #------------------------------------------------------------------------- # # Constants @@ -243,11 +251,14 @@ class PluginStatus: info.write(_("The following modules could not be loaded:")) info.write("\n\n") + for (file,msg) in _expect: + info.write("%s: %s\n\n" % (file,msg)) + for (file,msgs) in _failmsg: error = str(msgs[0]) if error[0:11] == "exceptions.": error = error[11:] - info.write("%s\t%s\n" % (file,error) ) + info.write("%s: %s\n" % (file,error) ) traceback.print_exception(msgs[0],msgs[1],msgs[2],None,info) info.write('\n') info.seek(0) @@ -298,6 +309,8 @@ def load_plugins(direct): try: a = __import__(plugin) _success.append(a) + except MissingLibraries,msg: + _expect.append((file,msg)) except: _failmsg.append((file,sys.exc_info())) diff --git a/src/SubstKeywords.py b/src/SubstKeywords.py index 90f59b977..79208d10b 100644 --- a/src/SubstKeywords.py +++ b/src/SubstKeywords.py @@ -77,11 +77,20 @@ class SubstKeywords: if len(person.getFamilyList()) > 0: f = person.getFamilyList()[0] if f.getFather() == person: - self.s = f.getMother().getPrimaryName().getRegularName() - self.S = f.getMother().getPrimaryName().getName() + if f.getMother(): + self.s = f.getMother().getPrimaryName().getRegularName() + self.S = f.getMother().getPrimaryName().getName() + else: + self.s = "" + self.S = "" else: - self.s = "" - self.S = "" + if f.getFather(): + self.s = f.getFather().getPrimaryName().getRegularName() + self.S = f.getFather().getPrimaryName().getName() + else: + self.s = "" + self.S = "" + self.m = '' self.M = '' for e in f.getEventList(): diff --git a/src/const.py b/src/const.py index d4f933027..50f7f17ac 100644 --- a/src/const.py +++ b/src/const.py @@ -92,7 +92,7 @@ startup = 1 # #------------------------------------------------------------------------- progName = "GRAMPS" -version = "0.8.0-pre" +version = "@VERSIONSTRING@" copyright = "© 2001-2002 Donald N. Allingham" authors = ["Donald N. Allingham", "David Hampton","Donald A. Peterson"] comments = _("GRAMPS (Genealogical Research and Analysis " @@ -106,7 +106,8 @@ comments = _("GRAMPS (Genealogical Research and Analysis " #------------------------------------------------------------------------- picWidth = 275.0 thumbScale = 96.0 -indexFile = "data.gramps" +xmlFile = "data.gramps" +zodbFile = "gramps.zodb" male = _("male") female = _("female") unknown = _("unknown") diff --git a/src/docgen/HtmlDoc.py b/src/docgen/HtmlDoc.py index f961c509b..48a226a73 100644 --- a/src/docgen/HtmlDoc.py +++ b/src/docgen/HtmlDoc.py @@ -77,6 +77,7 @@ class HtmlDoc(TextDoc): def __init__(self,styles,type,template,orientation,source=None): TextDoc.__init__(self,styles,PaperStyle("",0,0),template,None) self.year = time.localtime(time.time())[0] + self.ext = '.html' if source == None: self.copyright = 'Copyright © %d' % (self.year) self.map = None @@ -104,7 +105,6 @@ class HtmlDoc(TextDoc): self.table_styles = source.table_styles; self.cell_styles = source.cell_styles; self.image_dir = source.image_dir - self.ext = '.html' def set_extension(self,val): if val[0] != '.': diff --git a/src/docgen/PSDrawDoc.py b/src/docgen/PSDrawDoc.py index 101c301dd..6192d67f4 100644 --- a/src/docgen/PSDrawDoc.py +++ b/src/docgen/PSDrawDoc.py @@ -69,11 +69,11 @@ class PSDrawDoc(DrawDoc): return "%s findfont %d scalefont setfont\n" % (font_name,font.get_size()) def open(self,filename): - if filename[-4:] != ".ps": + if filename[-3:] != ".ps": self.filename = filename + ".ps" else: self.filename = filename - self.f = open(filename,"w") + self.f = open(self.filename,"w") self.f.write('%!PS-Adobe-3.0\n') self.f.write('%%LanguageLevel: 2\n') self.f.write('%%Pages: (atend)\n') diff --git a/src/docgen/PdfDoc.py b/src/docgen/PdfDoc.py index 8fb5af057..5329f6d90 100644 --- a/src/docgen/PdfDoc.py +++ b/src/docgen/PdfDoc.py @@ -43,7 +43,7 @@ try: from reportlab.lib.enums import TA_LEFT, TA_RIGHT, TA_CENTER, TA_JUSTIFY import reportlab.lib.styles except: - raise _("Missing Libraries"), _("The ReportLab modules are not installed") + raise Plugins.MissingLibraries, _("The ReportLab modules are not installed") #------------------------------------------------------------------------ # diff --git a/src/docgen/PdfDrawDoc.py b/src/docgen/PdfDrawDoc.py index e25ac2485..3a3c4eca6 100644 --- a/src/docgen/PdfDrawDoc.py +++ b/src/docgen/PdfDrawDoc.py @@ -32,7 +32,7 @@ try: from reportlab.lib.units import cm from reportlab.lib.colors import Color except: - raise _("Missing Libraries"), _("The ReportLab modules are not installed") + raise Plugins.MissingLibraries, _("The ReportLab modules are not installed") def make_color(color): return Color(float(color[0])/255.0, float(color[1])/255.0, diff --git a/src/filters/SubString.py b/src/filters/SubString.py index 13cd487af..60bd43b30 100644 --- a/src/filters/SubString.py +++ b/src/filters/SubString.py @@ -30,7 +30,9 @@ class SubString(Filter.Filter): "Names that contain a substring" def match(self,person): - return string.find(Utils.phonebook_name(person),self.text) >= 0 + s1 = string.lower(Utils.phonebook_name(person)) + s2 = string.lower(self.text) + return string.find(s1,s2) >= 0 #------------------------------------------------------------------------ # diff --git a/src/plugins/AncestorReport.py b/src/plugins/AncestorReport.py index bc38aee08..e4513fd1c 100644 --- a/src/plugins/AncestorReport.py +++ b/src/plugins/AncestorReport.py @@ -55,7 +55,7 @@ class AncestorReport(Report): gnome.ui.GnomeErrorDialog(_("Could not open %s") % output + "\n" + msg) def filter(self,person,index): - if person == None or index >= (1 << 31): + if person == None or index >= (1 << 30): return self.map[index] = person @@ -79,7 +79,7 @@ class AncestorReport(Report): generation = 0 for key in keys : - if generation == 0 or key >= ( 1 << 31): + if generation == 0 or key >= ( 1 << 30): if self.pgbrk and generation > 0: self.doc.page_break() self.doc.start_paragraph("Generation")