*** empty log message ***

svn: r955
This commit is contained in:
Don Allingham 2002-05-03 04:21:23 +00:00
parent 8f3fb34a07
commit e2e2070baf
6 changed files with 34 additions and 22 deletions

View File

@ -741,19 +741,27 @@ class SingleDate:
_format13] _format13]
def display_calendar(self,month_map): def display_calendar(self,month_map):
d = ''
if self.year==UNDEF: if self.year==UNDEF:
if self.month == UNDEF: if self.month == UNDEF:
return "" d = ""
elif self.day == UNDEF: elif self.day == UNDEF:
return month_map[self.month] d = month_map[self.month]
else: else:
return "%02d %s" % (self.day,month_map[self.month]) d = "%02d %s" % (self.day,month_map[self.month])
elif self.month == UNDEF: elif self.month == UNDEF:
return str(self.year) d = str(self.year)
elif self.day == UNDEF: elif self.day == UNDEF:
return "%s %d" % (month_map[self.month],self.year) d = "%s %d" % (month_map[self.month],self.year)
else: else:
return "%02d %s %d" % (self.day,month_map[self.month],self.year) d = "%02d %s %d" % (self.day,month_map[self.month],self.year)
if self.mode == SingleDate.about:
d = _("about") + ' ' + d
elif self.mode == SingleDate.before:
d = _("before") + ' ' + d
elif self.mode == SingleDate.after:
d = _("after") + ' ' + d
return d
def getDate(self): def getDate(self):
if self.calendar == GREGORIAN: if self.calendar == GREGORIAN:

View File

@ -912,6 +912,7 @@
<widget> <widget>
<class>GtkCList</class> <class>GtkCList</class>
<name>person_list</name> <name>person_list</name>
<width>750</width>
<height>350</height> <height>350</height>
<can_focus>True</can_focus> <can_focus>True</can_focus>
<signal> <signal>

View File

@ -64,7 +64,7 @@ class AncestorReport(Report):
# #
#-------------------------------------------------------------------- #--------------------------------------------------------------------
def filter(self,person,index): def filter(self,person,index):
if person == None or index >= 2**self.max_generations: if person == None or index >= (1 << 31):
return return
self.map[index] = person self.map[index] = person
@ -93,7 +93,7 @@ class AncestorReport(Report):
generation = 0 generation = 0
for key in keys : for key in keys :
if generation == 0 or key >= 2**generation: if generation == 0 or key >= ( 1 << 31):
if self.pgbrk and generation > 0: if self.pgbrk and generation > 0:
self.doc.page_break() self.doc.page_break()
self.doc.start_paragraph("Generation") self.doc.start_paragraph("Generation")

View File

@ -106,13 +106,13 @@ class DescendantReport:
def dump(self,level,person): def dump(self,level,person):
if level != 0: if level != 0:
self.doc.start_paragraph("Level" + str(level)) self.doc.start_paragraph("Level%d" % level)
self.doc.write_text(str(level) + '. ') self.doc.write_text("%d." % level)
self.doc.write_text(person.getPrimaryName().getRegularName()) self.doc.write_text(person.getPrimaryName().getRegularName())
self.dump_dates(person) self.dump_dates(person)
self.doc.end_paragraph() self.doc.end_paragraph()
if (level >= self.max_generations): if level >= self.max_generations:
return return
childlist = [] childlist = []
@ -172,11 +172,11 @@ class DescendantReportDialog(TextReportDialog):
self.default_style.add_style("Title",p) self.default_style.add_style("Title",p)
f = FontStyle() f = FontStyle()
for i in range(1,10): for i in range(1,32):
p = ParagraphStyle() p = ParagraphStyle()
p.set_font(f) p.set_font(f)
p.set_left_margin(float(i-1)) p.set_left_margin(max(10.0,float(i-1)))
self.default_style.add_style("Level" + str(i),p) self.default_style.add_style("Level%d" % i,p)
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# #

View File

@ -304,6 +304,7 @@ class DetAncestorReport(Report):
if len(famList) > 0: if len(famList) > 0:
for fam in famList: for fam in famList:
#print "Marriage:fam", fam.__dict__ #print "Marriage:fam", fam.__dict__
spouse = ''
if person.getGender() == RelLib.Person.male: if person.getGender() == RelLib.Person.male:
if fam.getMother() != None: if fam.getMother() != None:
spouse= fam.getMother().getPrimaryName().getRegularName() spouse= fam.getMother().getPrimaryName().getRegularName()

View File

@ -97,7 +97,7 @@ lineRE = re.compile(r"\s*(\d+)\s+(\S+)\s*(.*)$")
headRE = re.compile(r"\s*(\d+)\s+HEAD") headRE = re.compile(r"\s*(\d+)\s+HEAD")
nameRegexp= re.compile(r"/?([^/]*)(/([^/]*)(/([^/]*))?)?") nameRegexp= re.compile(r"/?([^/]*)(/([^/]*)(/([^/]*))?)?")
snameRegexp= re.compile(r"/([^/]*)/") snameRegexp= re.compile(r"/([^/]*)/")
calRegexp = re.compile(r"\s*@#D([^@]+)@\s*(.*)$") calRegexp = re.compile(r"\s*(ABT|BEF|AFT)?\s*@#D([^@]+)@\s*(.*)$")
fromtoRegexp = re.compile(r"\s*FROM\s+@#D([^@]+)@\s*(.*)\s+TO\s+@#D([^@]+)@\s*(.*)$") fromtoRegexp = re.compile(r"\s*FROM\s+@#D([^@]+)@\s*(.*)\s+TO\s+@#D([^@]+)@\s*(.*)$")
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -131,10 +131,12 @@ def importData(database, filename):
gnome.ui.GnomeErrorDialog(_("%s could not be opened\n") % filename) gnome.ui.GnomeErrorDialog(_("%s could not be opened\n") % filename)
return return
g.parse_gedcom_file() close = g.parse_gedcom_file()
g.resolve_refns() g.resolve_refns()
statusTop.get_widget("close").set_sensitive(1) statusTop.get_widget("close").set_sensitive(1)
if close:
statusWindow.destroy()
Utils.modified() Utils.modified()
if callback: if callback:
@ -313,8 +315,7 @@ class GedcomParser:
self.break_note_links() self.break_note_links()
t = time.time() - t t = time.time() - t
self.error_text_obj.insert_defaults(_('Import Complete: %d seconds') % t) self.error_text_obj.insert_defaults(_('Import Complete: %d seconds') % t)
if self.close_done.get_active(): return self.close_done.get_active()
self.window.destroy()
def break_note_links(self): def break_note_links(self):
for o in self.share_note: for o in self.share_note:
@ -609,7 +610,7 @@ class GedcomParser:
name = Name() name = Name()
m = snameRegexp.match(matches[2]) m = snameRegexp.match(matches[2])
if m: if m:
n = m.groups() n = m.groups()[0]
names = ('','',n,'','') names = ('','',n,'','')
else: else:
try: try:
@ -1418,7 +1419,6 @@ class GedcomParser:
"""Parses the person's name information""" """Parses the person's name information"""
while 1: while 1:
matches = self.get_next() matches = self.get_next()
if int(matches[0]) < level: if int(matches[0]) < level:
self.backup() self.backup()
return return
@ -1690,7 +1690,7 @@ class GedcomParser:
match = calRegexp.match(text) match = calRegexp.match(text)
if match: if match:
(cal,data) = match.groups() (abt,cal,data) = match.groups()
if cal == "FRENCH R": if cal == "FRENCH R":
dateobj.set_calendar(Date.FRENCH) dateobj.set_calendar(Date.FRENCH)
elif cal == "JULIAN": elif cal == "JULIAN":
@ -1698,6 +1698,8 @@ class GedcomParser:
elif cal == "HEBREW": elif cal == "HEBREW":
dateobj.set_calendar(Date.HEBREW) dateobj.set_calendar(Date.HEBREW)
dateobj.set(data) dateobj.set(data)
if abt:
dateobj.get_start_date().setMode(abt)
else: else:
dateobj.set(text) dateobj.set(text)