Fixed missing zodbFile and xmlFile constants

svn: r1065
This commit is contained in:
Don Allingham 2002-07-02 15:34:08 +00:00
parent 5ee01ceb04
commit 5c9100a9d3
11 changed files with 42 additions and 17 deletions

View File

@ -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)

View File

@ -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

View File

@ -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()))

View File

@ -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():

View File

@ -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")

View File

@ -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] != '.':

View File

@ -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')

View File

@ -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")
#------------------------------------------------------------------------
#

View File

@ -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,

View File

@ -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
#------------------------------------------------------------------------
#

View File

@ -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")