diff --git a/ChangeLog b/ChangeLog index d6bce392b..591c2eb72 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ +2007-10-08 Don Allingham + + * various: gen.lib integration. probably touches almost every file + 2007-10-07 Don Allingham - * various: gen.utils integrationk + * various: gen.utils integration 2007-10-07 Gary Burton * src/DataViews/_RelationView.py: init scroll pos on new person, issue #442 diff --git a/src/AddMedia.py b/src/AddMedia.py index c74c59e4d..09c8225c8 100644 --- a/src/AddMedia.py +++ b/src/AddMedia.py @@ -54,7 +54,7 @@ import gtk.glade #------------------------------------------------------------------------- import const import Utils -import RelLib +import gen.lib import Mime import GrampsDisplay import ManagedWindow @@ -130,7 +130,7 @@ class AddMediaObject(ManagedWindow.ManagedWindow): description = unicode(self.description.get_text()) if self.internal.get_active(): - mobj = RelLib.MediaObject() + mobj = gen.lib.MediaObject() mobj.set_description(description) mobj.set_handle(Utils.create_id()) mobj.set_mime_type(None) @@ -155,7 +155,7 @@ class AddMediaObject(ManagedWindow.ManagedWindow): if description == "": description = os.path.basename(filename) - mobj = RelLib.MediaObject() + mobj = gen.lib.MediaObject() mobj.set_description(description) mobj.set_mime_type(mtype) name = filename diff --git a/src/BasicUtils/_NameDisplay.py b/src/BasicUtils/_NameDisplay.py index 1c4fe3940..1e8c53fd8 100644 --- a/src/BasicUtils/_NameDisplay.py +++ b/src/BasicUtils/_NameDisplay.py @@ -37,7 +37,7 @@ import re # GRAMPS modules # #------------------------------------------------------------------------- -from RelLib import Name +from gen.lib import Name from Errors import NameDisplayError try: @@ -455,15 +455,15 @@ class NameDisplay: def sorted(self,person): """ - Returns a text string representing the L{RelLib.Person} instance's + Returns a text string representing the L{gen.lib.Person} instance's L{Name} in a manner that should be used for displaying a sorted name. - @param person: L{RelLib.Person} instance that contains the + @param person: L{gen.lib.Person} instance that contains the L{Name} that is to be displayed. The primary name is used for the display. - @type person: L{RelLib.Person} - @returns: Returns the L{RelLib.Person} instance's name + @type person: L{gen.lib.Person} + @returns: Returns the L{gen.lib.Person} instance's name @rtype: str """ name = person.get_primary_name() @@ -499,14 +499,14 @@ class NameDisplay: def display(self,person): """ - Returns a text string representing the L{RelLib.Person} instance's + Returns a text string representing the L{gen.lib.Person} instance's L{Name} in a manner that should be used for normal displaying. - @param person: L{RelLib.Person} instance that contains the + @param person: L{gen.lib.Person} instance that contains the L{Name} that is to be displayed. The primary name is used for the display. - @type person: L{RelLib.Person} - @returns: Returns the L{RelLib.Person} instance's name + @type person: L{gen.lib.Person} + @returns: Returns the L{gen.lib.Person} instance's name @rtype: str """ name = person.get_primary_name() @@ -514,14 +514,14 @@ class NameDisplay: def display_formal(self,person): """ - Returns a text string representing the L{RelLib.Person} instance's + Returns a text string representing the L{gen.lib.Person} instance's L{Name} in a manner that should be used for normal displaying. - @param person: L{RelLib.Person} instance that contains the + @param person: L{gen.lib.Person} instance that contains the L{Name} that is to be displayed. The primary name is used for the display. - @type person: L{RelLib.Person} - @returns: Returns the L{RelLib.Person} instance's name + @type person: L{gen.lib.Person} + @returns: Returns the L{gen.lib.Person} instance's name @rtype: str """ # FIXME: At this time, this is just duplicating display() method diff --git a/src/DataViews/_EventView.py b/src/DataViews/_EventView.py index 8c0a3f72e..00b306c7d 100644 --- a/src/DataViews/_EventView.py +++ b/src/DataViews/_EventView.py @@ -31,7 +31,7 @@ __revision__ = "$Revision$" # gramps modules # #------------------------------------------------------------------------- -import RelLib +import gen.lib import PageView import DisplayModels import Utils @@ -207,7 +207,7 @@ class EventView(PageView.ListView): def add(self, obj): try: - EditEvent(self.dbstate, self.uistate, [], RelLib.Event()) + EditEvent(self.dbstate, self.uistate, [], gen.lib.Event()) except Errors.WindowActiveError: pass diff --git a/src/DataViews/_FamilyList.py b/src/DataViews/_FamilyList.py index cdabb617c..d667d4c13 100644 --- a/src/DataViews/_FamilyList.py +++ b/src/DataViews/_FamilyList.py @@ -31,7 +31,7 @@ __revision__ = "$Revision$" # gramps modules # #------------------------------------------------------------------------- -import RelLib +import gen.lib import PageView import DisplayModels import Bookmarks @@ -193,7 +193,7 @@ class FamilyListView(PageView.ListView): def add(self, obj): from Editors import EditFamily - family = RelLib.Family() + family = gen.lib.Family() try: EditFamily(self.dbstate, self.uistate, [], family) except Errors.WindowActiveError: diff --git a/src/DataViews/_MediaView.py b/src/DataViews/_MediaView.py index b313b54c1..2c71a6052 100644 --- a/src/DataViews/_MediaView.py +++ b/src/DataViews/_MediaView.py @@ -56,7 +56,7 @@ import Config import Utils import Bookmarks import Mime -import RelLib +import gen.lib from Editors import EditMedia, DeleteMediaQuery import Errors @@ -187,7 +187,7 @@ class MediaView(PageView.ListView): mime = Mime.get_type(name) if not Mime.is_valid_type(mime): return - photo = RelLib.MediaObject() + photo = gen.lib.MediaObject() photo.set_path(name) photo.set_mime_type(mime) basename = os.path.basename(name) diff --git a/src/DataViews/_NoteView.py b/src/DataViews/_NoteView.py index cfb4f0431..47f3c723b 100644 --- a/src/DataViews/_NoteView.py +++ b/src/DataViews/_NoteView.py @@ -45,7 +45,7 @@ import Errors import Bookmarks import Config import ColumnOrder -from RelLib import Note +from gen.lib import Note from DdTargets import DdTargets from QuestionDialog import QuestionDialog, ErrorDialog from Filters.SideBar import NoteSidebarFilter diff --git a/src/DataViews/_PedigreeView.py b/src/DataViews/_PedigreeView.py index a12017822..6b83377f4 100644 --- a/src/DataViews/_PedigreeView.py +++ b/src/DataViews/_PedigreeView.py @@ -49,7 +49,7 @@ except: # Gramps Modules # #------------------------------------------------------------------------- -import RelLib +import gen.lib import PageView from BasicUtils import name_displayer import Utils @@ -81,9 +81,9 @@ class PersonBoxWidget_old( gtk.Button): if person: gtk.Button.__init__(self, fh.format_person(person, maxlines)) gender = person.get_gender() - if gender == RelLib.Person.MALE: + if gender == gen.lib.Person.MALE: self.modify_bg( gtk.STATE_NORMAL, self.get_colormap().alloc_color("#F5FFFF")) - elif gender == RelLib.Person.FEMALE: + elif gender == gen.lib.Person.FEMALE: self.modify_bg( gtk.STATE_NORMAL, self.get_colormap().alloc_color("#FFF5FF")) else: self.modify_bg( gtk.STATE_NORMAL, self.get_colormap().alloc_color("#FFFFF5")) @@ -135,19 +135,19 @@ class PersonBoxWidget_cairo( gtk.DrawingArea, _PersonWidget_base): self.text = "" if self.person: self.text = self.fh.format_person(self.person,self.maxlines,True) - if alive and self.person.get_gender() == RelLib.Person.MALE: + if alive and self.person.get_gender() == gen.lib.Person.MALE: self.bgcolor = (185/256.0, 207/256.0, 231/256.0) self.bordercolor = (32/256.0, 74/256.0, 135/256.0) - elif alive and self.person.get_gender() == RelLib.Person.FEMALE: + elif alive and self.person.get_gender() == gen.lib.Person.FEMALE: self.bgcolor = (255/256.0, 205/256.0, 241/256.0) self.bordercolor = (135/256.0, 32/256.0, 106/256.0) elif alive: self.bgcolor = (244/256.0, 220/256.0, 183/256.0) self.bordercolor = (143/256.0, 89/256.0, 2/256.0) - elif self.person.get_gender() == RelLib.Person.MALE: + elif self.person.get_gender() == gen.lib.Person.MALE: self.bgcolor = (185/256.0, 207/256.0, 231/256.0) self.bordercolor = (0,0,0) - elif self.person.get_gender() == RelLib.Person.FEMALE: + elif self.person.get_gender() == gen.lib.Person.FEMALE: self.bgcolor = (255/256.0, 205/256.0, 241/256.0) self.bordercolor = (0,0,0) else: @@ -305,16 +305,16 @@ class PersonBoxWidget( gtk.DrawingArea, _PersonWidget_base): self.shadow_gc.line_style = gtk.gdk.LINE_SOLID self.shadow_gc.line_width = 4 if self.person: - if self.alive and self.person.get_gender() == RelLib.Person.MALE: + if self.alive and self.person.get_gender() == gen.lib.Person.MALE: self.bg_gc.set_foreground( self.get_colormap().alloc_color("#b9cfe7")) self.border_gc.set_foreground( self.get_colormap().alloc_color("#204a87")) - elif self.person.get_gender() == RelLib.Person.MALE: + elif self.person.get_gender() == gen.lib.Person.MALE: self.bg_gc.set_foreground( self.get_colormap().alloc_color("#b9cfe7")) self.border_gc.set_foreground( self.get_colormap().alloc_color("#000000")) - elif self.alive and self.person.get_gender() == RelLib.Person.FEMALE: + elif self.alive and self.person.get_gender() == gen.lib.Person.FEMALE: self.bg_gc.set_foreground( self.get_colormap().alloc_color("#ffcdf1")) self.border_gc.set_foreground( self.get_colormap().alloc_color("#87206a")) - elif self.person.get_gender() == RelLib.Person.FEMALE: + elif self.person.get_gender() == gen.lib.Person.FEMALE: self.bg_gc.set_foreground( self.get_colormap().alloc_color("#ffcdf1")) self.border_gc.set_foreground( self.get_colormap().alloc_color("#000000")) elif self.alive: @@ -358,7 +358,7 @@ class FormattingHelper: text = "" for event_ref in family.get_event_ref_list(): event = self.dbstate.db.get_event_from_handle(event_ref.ref) - if event and event.get_type() == RelLib.EventType.MARRIAGE: + if event and event.get_type() == gen.lib.EventType.MARRIAGE: if line_count < 3: return DateHandler.get_date(event) name = str(event.get_type()) @@ -402,7 +402,7 @@ class FormattingHelper: text = name if line_count >= 3: birth = ReportUtils.get_birth_or_fallback(self.dbstate.db, person) - if birth and use_markup and birth.get_type() != RelLib.EventType.BIRTH: + if birth and use_markup and birth.get_type() != gen.lib.EventType.BIRTH: bdate = "%s" % escape(DateHandler.get_date(birth)) bplace = "%s" % escape(self.get_place_name(birth.get_place_handle())) elif birth and use_markup: @@ -415,7 +415,7 @@ class FormattingHelper: bdate = "" bplace = "" death = ReportUtils.get_death_or_fallback(self.dbstate.db, person) - if death and use_markup and death.get_type() != RelLib.EventType.DEATH: + if death and use_markup and death.get_type() != gen.lib.EventType.DEATH: ddate = "%s" % escape(DateHandler.get_date(death)) dplace = "%s" % escape(self.get_place_name(death.get_place_handle())) elif death and use_markup: @@ -1111,8 +1111,8 @@ class PedigreeView(PageView.PersonNavView): if family_handle: # one parent already exists -> Edit current family family = self.dbstate.db.get_family_from_handle(family_handle) else: # no parents -> create new family - family = RelLib.Family() - childref = RelLib.ChildRef() + family = gen.lib.Family() + childref = gen.lib.ChildRef() childref.set_reference_handle(person_handle) family.add_child_ref(childref) try: @@ -1274,8 +1274,8 @@ class PedigreeView(PageView.PersonNavView): if family != None: for child_ref in family.get_child_ref_list(): if child_ref.ref == person.handle: - mrel = child_ref.mrel == RelLib.ChildRefType.BIRTH - frel = child_ref.frel == RelLib.ChildRefType.BIRTH + mrel = child_ref.mrel == gen.lib.ChildRefType.BIRTH + frel = child_ref.frel == gen.lib.ChildRefType.BIRTH lst[index] = (person,val,family,alive) father_handle = family.get_father_handle() @@ -1777,10 +1777,10 @@ def build_detail_string(db,person): else: for event_ref in person.get_event_ref_list(): event = db.get_event_from_handle(event_ref.ref) - if event and event.get_type() == RelLib.EventType.BAPTISM: + if event and event.get_type() == gen.lib.EventType.BAPTISM: detail_text += format_event(db, _BAPT, event) break - if event and event.get_type() == RelLib.EventType.CHRISTEN: + if event and event.get_type() == gen.lib.EventType.CHRISTEN: detail_text += format_event(db, _CHRI, event) break @@ -1791,10 +1791,10 @@ def build_detail_string(db,person): else: for event_ref in person.get_event_ref_list(): event = db.get_event_from_handle(event_ref.ref) - if event and event.get_type() == RelLib.EventType.BURIAL: + if event and event.get_type() == gen.lib.EventType.BURIAL: detail_text += format_event(db, _BURI, event) break - if event and event.get_type() == RelLib.EventType.CREMATION: + if event and event.get_type() == gen.lib.EventType.CREMATION: detail_text += format_event(db, _CREM, event) break diff --git a/src/DataViews/_PersonView.py b/src/DataViews/_PersonView.py index 3949a1662..869bfc383 100644 --- a/src/DataViews/_PersonView.py +++ b/src/DataViews/_PersonView.py @@ -50,7 +50,7 @@ from gtk.gdk import ACTION_COPY, BUTTON1_MASK # GRAMPS modules # #------------------------------------------------------------------------- -import RelLib +import gen.lib from DisplayModels import PeopleModel import PageView from BasicUtils import name_displayer @@ -551,7 +551,7 @@ class PersonView(PageView.PersonNavView): self.dirty = True def add(self, obj): - person = RelLib.Person() + person = gen.lib.Person() # attempt to get the current surname diff --git a/src/DataViews/_PlaceView.py b/src/DataViews/_PlaceView.py index 6dd34bae8..2eecc214f 100644 --- a/src/DataViews/_PlaceView.py +++ b/src/DataViews/_PlaceView.py @@ -38,7 +38,7 @@ import gtk # gramps modules # #------------------------------------------------------------------------- -import RelLib +import gen.lib import PageView import DisplayModels import Utils @@ -227,7 +227,7 @@ class PlaceView(PageView.ListView): def add(self, obj): try: - EditPlace(self.dbstate, self.uistate, [], RelLib.Place()) + EditPlace(self.dbstate, self.uistate, [], gen.lib.Place()) except Errors.WindowActiveError: pass diff --git a/src/DataViews/_RelationView.py b/src/DataViews/_RelationView.py index 5d5cefae0..cee7f1b03 100644 --- a/src/DataViews/_RelationView.py +++ b/src/DataViews/_RelationView.py @@ -46,7 +46,7 @@ import gtk # Gramps Modules # #------------------------------------------------------------------------- -import RelLib +import gen.lib import PageView from BasicUtils import name_displayer import DateHandler @@ -59,9 +59,9 @@ import gen.utils from ReportBase import ReportUtils _GenderCode = { - RelLib.Person.MALE : u'\u2642', - RelLib.Person.FEMALE : u'\u2640', - RelLib.Person.UNKNOWN : u'\u2650', + gen.lib.Person.MALE : u'\u2642', + gen.lib.Person.FEMALE : u'\u2640', + gen.lib.Person.UNKNOWN : u'\u2650', } _NAME_START = 0 @@ -745,9 +745,9 @@ class RelationshipView(PageView.PersonNavView): elif count == 1 : gender = self.dbstate.db.get_person_from_handle(\ child_list[0]).gender - if gender == RelLib.Person.MALE : + if gender == gen.lib.Person.MALE : childmsg = _(" (1 brother)") - elif gender == RelLib.Person.FEMALE : + elif gender == gen.lib.Person.FEMALE : childmsg = _(" (1 sister)") else : childmsg = _(" (1 sibling)") @@ -934,7 +934,7 @@ class RelationshipView(PageView.PersonNavView): return None birth = ReportUtils.get_birth_or_fallback(self.dbstate.db, child) - if birth and birth.get_type != RelLib.EventType.BIRTH: + if birth and birth.get_type != gen.lib.EventType.BIRTH: bdate = "%s" % cgi.escape(DateHandler.get_date(birth)) elif birth: bdate = cgi.escape(DateHandler.get_date(birth)) @@ -942,7 +942,7 @@ class RelationshipView(PageView.PersonNavView): bdate = "" death = ReportUtils.get_death_or_fallback(self.dbstate.db, child) - if death and death.get_type != RelLib.EventType.DEATH: + if death and death.get_type != gen.lib.EventType.DEATH: ddate = "%s" % cgi.escape(DateHandler.get_date(death)) elif death: ddate = cgi.escape(DateHandler.get_date(death)) @@ -1030,7 +1030,7 @@ class RelationshipView(PageView.PersonNavView): for event_ref in family.get_event_ref_list(): handle = event_ref.ref event = self.dbstate.db.get_event_from_handle(handle) - if event.get_type() == RelLib.EventType.MARRIAGE: + if event.get_type() == gen.lib.EventType.MARRIAGE: self.write_event_ref(vbox, _('Marriage'), event) value = True return value @@ -1172,12 +1172,12 @@ class RelationshipView(PageView.PersonNavView): def add_family(self, obj, event, handle): if event.type == gtk.gdk.BUTTON_PRESS and event.button == 1: from Editors import EditFamily - family = RelLib.Family() + family = gen.lib.Family() person = self.dbstate.active if not person: return - if person.gender == RelLib.Person.MALE: + if person.gender == gen.lib.Person.MALE: family.set_father_handle(person.handle) else: family.set_mother_handle(person.handle) @@ -1189,13 +1189,13 @@ class RelationshipView(PageView.PersonNavView): def add_spouse(self, obj): from Editors import EditFamily - family = RelLib.Family() + family = gen.lib.Family() person = self.dbstate.active if not person: return - if person.gender == RelLib.Person.MALE: + if person.gender == gen.lib.Person.MALE: family.set_father_handle(person.handle) else: family.set_mother_handle(person.handle) @@ -1253,13 +1253,13 @@ class RelationshipView(PageView.PersonNavView): def add_parents(self, obj): from Editors import EditFamily - family = RelLib.Family() + family = gen.lib.Family() person = self.dbstate.active if not person: return - ref = RelLib.ChildRef() + ref = gen.lib.ChildRef() ref.ref = person.handle family.add_child_ref(ref) @@ -1271,10 +1271,10 @@ class RelationshipView(PageView.PersonNavView): def add_parent_family(self, obj, event, handle): if event.type == gtk.gdk.BUTTON_PRESS and event.button == 1: from Editors import EditFamily - family = RelLib.Family() + family = gen.lib.Family() person = self.dbstate.active - ref = RelLib.ChildRef() + ref = gen.lib.ChildRef() ref.ref = person.handle family.add_child_ref(ref) diff --git a/src/DataViews/_RepositoryView.py b/src/DataViews/_RepositoryView.py index a7c560d39..5a652501b 100644 --- a/src/DataViews/_RepositoryView.py +++ b/src/DataViews/_RepositoryView.py @@ -38,7 +38,7 @@ import gtk # gramps modules # #------------------------------------------------------------------------- -import RelLib +import gen.lib import PageView import DisplayModels import Utils @@ -190,7 +190,7 @@ class RepositoryView(PageView.ListView): pass def add(self, obj): - EditRepository(self.dbstate, self.uistate, [], RelLib.Repository()) + EditRepository(self.dbstate, self.uistate, [], gen.lib.Repository()) def remove(self, obj): db = self.dbstate.db diff --git a/src/DataViews/_SourceView.py b/src/DataViews/_SourceView.py index b72b7e8b5..15dd3f050 100644 --- a/src/DataViews/_SourceView.py +++ b/src/DataViews/_SourceView.py @@ -38,7 +38,7 @@ import gtk # gramps modules # #------------------------------------------------------------------------- -import RelLib +import gen.lib import Config import PageView import DisplayModels @@ -189,7 +189,7 @@ class SourceView(PageView.ListView): pass def add(self, obj): - EditSource(self.dbstate, self.uistate, [], RelLib.Source()) + EditSource(self.dbstate, self.uistate, [], gen.lib.Source()) def remove(self, obj): for source_handle in self.selected_handles(): diff --git a/src/Date.py b/src/Date.py index ace3f6dec..082f93462 100644 --- a/src/Date.py +++ b/src/Date.py @@ -26,4 +26,4 @@ this module is only needed to to enable db upgrade """ -from RelLib import Date +from gen.lib import Date diff --git a/src/DateEdit.py b/src/DateEdit.py index 1af9123a3..946c80255 100644 --- a/src/DateEdit.py +++ b/src/DateEdit.py @@ -63,7 +63,7 @@ import gtk # gramps modules # #------------------------------------------------------------------------- -from RelLib import Date +from gen.lib import Date import DateHandler import const import GrampsDisplay diff --git a/src/DateHandler/_DateDisplay.py b/src/DateHandler/_DateDisplay.py index 805fd0ab4..f3652b594 100644 --- a/src/DateHandler/_DateDisplay.py +++ b/src/DateHandler/_DateDisplay.py @@ -41,7 +41,7 @@ log = logging.getLogger(".DateDisplay") # GRAMPS modules # #------------------------------------------------------------------------- -from RelLib import Date +from gen.lib import Date import GrampsLocale #------------------------------------------------------------------------- diff --git a/src/DateHandler/_DateParser.py b/src/DateHandler/_DateParser.py index 650d7b794..08fe6b73d 100644 --- a/src/DateHandler/_DateParser.py +++ b/src/DateHandler/_DateParser.py @@ -51,7 +51,7 @@ log = logging.getLogger(".DateParser") # GRAMPS modules # #------------------------------------------------------------------------- -from RelLib import Date, DateError +from gen.lib import Date, DateError import GrampsLocale #------------------------------------------------------------------------- diff --git a/src/DateHandler/_Date_de.py b/src/DateHandler/_Date_de.py index 9ab414b2a..a8f1b2f44 100644 --- a/src/DateHandler/_Date_de.py +++ b/src/DateHandler/_Date_de.py @@ -37,7 +37,7 @@ import re # GRAMPS modules # #------------------------------------------------------------------------- -from RelLib import Date +from gen.lib import Date from _DateParser import DateParser from _DateDisplay import DateDisplay from _DateHandler import register_datehandler diff --git a/src/DateHandler/_Date_es.py b/src/DateHandler/_Date_es.py index 4d621a0ac..f14db1eb5 100644 --- a/src/DateHandler/_Date_es.py +++ b/src/DateHandler/_Date_es.py @@ -37,7 +37,7 @@ import re # GRAMPS modules # #------------------------------------------------------------------------- -from RelLib import Date +from gen.lib import Date from _DateParser import DateParser from _DateDisplay import DateDisplay from _DateHandler import register_datehandler diff --git a/src/DateHandler/_Date_fi.py b/src/DateHandler/_Date_fi.py index a88ed89ae..5d7ea2d82 100644 --- a/src/DateHandler/_Date_fi.py +++ b/src/DateHandler/_Date_fi.py @@ -37,7 +37,7 @@ import re # GRAMPS modules # #------------------------------------------------------------------------- -from RelLib import Date +from gen.lib import Date from _DateParser import DateParser from _DateDisplay import DateDisplay from _DateHandler import register_datehandler diff --git a/src/DateHandler/_Date_fr.py b/src/DateHandler/_Date_fr.py index 68db1cfdb..58e010da8 100644 --- a/src/DateHandler/_Date_fr.py +++ b/src/DateHandler/_Date_fr.py @@ -37,7 +37,7 @@ import re # GRAMPS modules # #------------------------------------------------------------------------- -from RelLib import Date +from gen.lib import Date from _DateParser import DateParser from _DateDisplay import DateDisplay from _DateHandler import register_datehandler diff --git a/src/DateHandler/_Date_lt.py b/src/DateHandler/_Date_lt.py index 268bd31cc..be1ef9581 100644 --- a/src/DateHandler/_Date_lt.py +++ b/src/DateHandler/_Date_lt.py @@ -37,7 +37,7 @@ import re # GRAMPS modules # #------------------------------------------------------------------------- -from RelLib import Date +from gen.lib import Date from _DateParser import DateParser from _DateDisplay import DateDisplay from _DateHandler import register_datehandler diff --git a/src/DateHandler/_Date_nl.py b/src/DateHandler/_Date_nl.py index a0039ef97..bef4849e8 100644 --- a/src/DateHandler/_Date_nl.py +++ b/src/DateHandler/_Date_nl.py @@ -43,7 +43,7 @@ import re # GRAMPS modules # #------------------------------------------------------------------------- -from RelLib import Date +from gen.lib import Date from _DateParser import DateParser from _DateDisplay import DateDisplay from _DateHandler import register_datehandler diff --git a/src/DateHandler/_Date_pl.py b/src/DateHandler/_Date_pl.py index 8b38172e7..2eb4f5e2c 100644 --- a/src/DateHandler/_Date_pl.py +++ b/src/DateHandler/_Date_pl.py @@ -37,7 +37,7 @@ import re # GRAMPS modules # #------------------------------------------------------------------------- -from RelLib import Date +from gen.lib import Date from _DateParser import DateParser from _DateDisplay import DateDisplay from _DateHandler import register_datehandler diff --git a/src/DateHandler/_Date_ru.py b/src/DateHandler/_Date_ru.py index a2b7715e3..9146fde06 100644 --- a/src/DateHandler/_Date_ru.py +++ b/src/DateHandler/_Date_ru.py @@ -37,7 +37,7 @@ import re # GRAMPS modules # #------------------------------------------------------------------------- -from RelLib import Date +from gen.lib import Date from _DateParser import DateParser from _DateDisplay import DateDisplay from _DateHandler import register_datehandler diff --git a/src/DateHandler/_Date_sk.py b/src/DateHandler/_Date_sk.py index 3b919530a..b9758e0b7 100644 --- a/src/DateHandler/_Date_sk.py +++ b/src/DateHandler/_Date_sk.py @@ -37,7 +37,7 @@ import re # GRAMPS modules # #------------------------------------------------------------------------- -from RelLib import Date +from gen.lib import Date from _DateParser import DateParser from _DateDisplay import DateDisplay from _DateHandler import register_datehandler diff --git a/src/DateHandler/_Date_sv.py b/src/DateHandler/_Date_sv.py index f39488cc9..6c70a9e4c 100644 --- a/src/DateHandler/_Date_sv.py +++ b/src/DateHandler/_Date_sv.py @@ -37,7 +37,7 @@ import re # GRAMPS modules # #------------------------------------------------------------------------- -from RelLib import Date +from gen.lib import Date from _DateParser import DateParser from _DateDisplay import DateDisplay from _DateHandler import register_datehandler diff --git a/src/DisplayModels/_EventModel.py b/src/DisplayModels/_EventModel.py index a6897b47d..42de67bcc 100644 --- a/src/DisplayModels/_EventModel.py +++ b/src/DisplayModels/_EventModel.py @@ -43,7 +43,7 @@ import gtk import ToolTips import GrampsLocale import DateHandler -import RelLib +import gen.lib from _BaseModel import BaseModel #------------------------------------------------------------------------- @@ -107,21 +107,21 @@ class EventModel(BaseModel): return u'' def column_type(self,data): - return str(RelLib.EventType(data[COLUMN_TYPE])) + return str(gen.lib.EventType(data[COLUMN_TYPE])) def column_id(self,data): return unicode(data[COLUMN_ID]) def column_date(self,data): if data[COLUMN_DATE]: - event = RelLib.Event() + event = gen.lib.Event() event.unserialize(data) return DateHandler.get_date(event) return u'' def sort_date(self,data): if data[COLUMN_DATE]: - event = RelLib.Event() + event = gen.lib.Event() event.unserialize(data) return "%09d" % event.get_date_object().get_sort_value() return u'' diff --git a/src/DisplayModels/_FamilyModel.py b/src/DisplayModels/_FamilyModel.py index 2150e1ca6..d90c553d3 100644 --- a/src/DisplayModels/_FamilyModel.py +++ b/src/DisplayModels/_FamilyModel.py @@ -45,7 +45,7 @@ import ToolTips import GrampsLocale import DateHandler from BasicUtils import name_displayer -import RelLib +import gen.lib import gen.utils from _BaseModel import BaseModel @@ -126,10 +126,10 @@ class FamilyModel(BaseModel): return u"" def column_type(self, data): - return str(RelLib.FamilyRelType(data[5])) + return str(gen.lib.FamilyRelType(data[5])) def column_marriage(self, data): - erlist = [ RelLib.EventRef().unserialize(d) for d in data[6] ] + erlist = [ gen.lib.EventRef().unserialize(d) for d in data[6] ] event = gen.utils.marriage_from_eventref_list(self.db, erlist) if event: return DateHandler.displayer.display(event.date) @@ -137,7 +137,7 @@ class FamilyModel(BaseModel): return u'' def sort_marriage(self, data): - erlist = [ RelLib.EventRef().unserialize(d) for d in data[6] ] + erlist = [ gen.lib.EventRef().unserialize(d) for d in data[6] ] event = gen.utils.marriage_from_eventref_list(self.db, erlist) if event: return "%09d" % event.date.get_sort_value() @@ -165,11 +165,11 @@ class FamilyModel(BaseModel): def column_marker_color(self, data): try: col = data[FamilyModel._MARKER_COL][0] - if col == RelLib.MarkerType.COMPLETE: + if col == gen.lib.MarkerType.COMPLETE: return self.complete_color - elif col == RelLib.MarkerType.TODO_TYPE: + elif col == gen.lib.MarkerType.TODO_TYPE: return self.todo_color - elif col == RelLib.MarkerType.CUSTOM: + elif col == gen.lib.MarkerType.CUSTOM: return self.custom_color except IndexError: pass diff --git a/src/DisplayModels/_MediaModel.py b/src/DisplayModels/_MediaModel.py index 7f42082f2..62a5e0392 100644 --- a/src/DisplayModels/_MediaModel.py +++ b/src/DisplayModels/_MediaModel.py @@ -45,7 +45,7 @@ import const import ToolTips import GrampsLocale import DateHandler -import RelLib +import gen.lib from _BaseModel import BaseModel #------------------------------------------------------------------------- @@ -109,13 +109,13 @@ class MediaModel(BaseModel): def column_date(self,data): if data[9]: - date = RelLib.Date() + date = gen.lib.Date() date.unserialize(data[9]) return unicode(DateHandler.displayer.display(date)) return u'' def sort_date(self,data): - obj = RelLib.MediaObject() + obj = gen.lib.MediaObject() obj.unserialize(data) d = obj.get_date_object() if d: diff --git a/src/DisplayModels/_NoteModel.py b/src/DisplayModels/_NoteModel.py index d5335857d..689ee871e 100644 --- a/src/DisplayModels/_NoteModel.py +++ b/src/DisplayModels/_NoteModel.py @@ -45,7 +45,7 @@ import const import ToolTips import GrampsLocale from _BaseModel import BaseModel -import RelLib +import gen.lib #------------------------------------------------------------------------- # @@ -146,12 +146,12 @@ class NoteModel(BaseModel): return unicode(data[1]) def column_type(self,data): - temp = RelLib.NoteType() + temp = gen.lib.NoteType() temp.set(data[4]) return unicode(str(temp)) def column_marker(self, data): - temp = RelLib.MarkerType() + temp = gen.lib.MarkerType() temp.set(data[6]) return unicode(str(temp)) @@ -170,11 +170,11 @@ class NoteModel(BaseModel): def column_marker_color(self, data): try: col = data[NoteModel._MARKER_COL][0] - if col == RelLib.MarkerType.COMPLETE: + if col == gen.lib.MarkerType.COMPLETE: return self.complete_color - elif col == RelLib.MarkerType.TODO_TYPE: + elif col == gen.lib.MarkerType.TODO_TYPE: return self.todo_color - elif col == RelLib.MarkerType.CUSTOM: + elif col == gen.lib.MarkerType.CUSTOM: return self.custom_color except IndexError: pass diff --git a/src/DisplayModels/_PeopleModel.py b/src/DisplayModels/_PeopleModel.py index 555dea11b..9122788f6 100644 --- a/src/DisplayModels/_PeopleModel.py +++ b/src/DisplayModels/_PeopleModel.py @@ -59,7 +59,7 @@ import gtk # #------------------------------------------------------------------------- import const -from RelLib import * +from gen.lib import * from BasicUtils import name_displayer import DateHandler import ToolTips diff --git a/src/DisplayModels/_RepositoryModel.py b/src/DisplayModels/_RepositoryModel.py index 11c7f6ce5..f3c0081d7 100644 --- a/src/DisplayModels/_RepositoryModel.py +++ b/src/DisplayModels/_RepositoryModel.py @@ -39,7 +39,7 @@ import gtk # GRAMPS modules # #------------------------------------------------------------------------- -import RelLib +import gen.lib from _BaseModel import BaseModel #------------------------------------------------------------------------- @@ -100,7 +100,7 @@ class RepositoryModel(BaseModel): return unicode(data[1]) def column_type(self,data): - return str(RelLib.RepositoryType(data[2])) + return str(gen.lib.RepositoryType(data[2])) def column_name(self,data): return unicode(data[3]) @@ -108,7 +108,7 @@ class RepositoryModel(BaseModel): def column_city(self,data): try: if data[4]: - addr = RelLib.Address() + addr = gen.lib.Address() addr.unserialize(data[4][0]) return addr.get_city() else: @@ -119,7 +119,7 @@ class RepositoryModel(BaseModel): def column_street(self,data): try: if data[5]: - addr = RelLib.Address() + addr = gen.lib.Address() addr.unserialize(data[5][0]) return addr.get_street() else: @@ -130,7 +130,7 @@ class RepositoryModel(BaseModel): def column_county(self,data): try: if data[5]: - addr = RelLib.Address() + addr = gen.lib.Address() addr.unserialize(data[5][0]) return addr.get_county() else: @@ -141,7 +141,7 @@ class RepositoryModel(BaseModel): def column_state(self,data): try: if data[5]: - addr = RelLib.Address() + addr = gen.lib.Address() addr.unserialize(data[5][0]) return addr.get_state() else: @@ -152,7 +152,7 @@ class RepositoryModel(BaseModel): def column_country(self,data): try: if data[5]: - addr = RelLib.Address() + addr = gen.lib.Address() addr.unserialize(data[5][0]) return addr.get_country() else: @@ -163,7 +163,7 @@ class RepositoryModel(BaseModel): def column_postal_code(self,data): try: if data[5]: - addr = RelLib.Address() + addr = gen.lib.Address() addr.unserialize(data[5][0]) return addr.get_postal_code() else: @@ -174,7 +174,7 @@ class RepositoryModel(BaseModel): def column_phone(self,data): try: if data[5]: - addr = RelLib.Address() + addr = gen.lib.Address() addr.unserialize(data[5][0]) return addr.get_phone() else: @@ -185,27 +185,27 @@ class RepositoryModel(BaseModel): def column_email(self,data): if data[6]: for i in data[6]: - url = RelLib.Url() + url = gen.lib.Url() url.unserialize(i) - if url.get_type() == RelLib.UrlType.EMAIL: + if url.get_type() == gen.lib.UrlType.EMAIL: return unicode(url.path) return u'' def column_search_url(self,data): if data[6]: for i in data[6]: - url = RelLib.Url() + url = gen.lib.Url() url.unserialize(i) - if url.get_type() == RelLib.UrlType.WEB_SEARCH: + if url.get_type() == gen.lib.UrlType.WEB_SEARCH: return unicode(url.path) return u'' def column_home_url(self,data): if data[6]: for i in data[6]: - url = RelLib.Url() + url = gen.lib.Url() url.unserialize(i) - if url.get_type() == RelLib.UrlType.WEB_HOME: + if url.get_type() == gen.lib.UrlType.WEB_HOME: return unicode(url.path) return u"" diff --git a/src/DisplayTabs/_AddrEmbedList.py b/src/DisplayTabs/_AddrEmbedList.py index 9ba10d354..741acc283 100644 --- a/src/DisplayTabs/_AddrEmbedList.py +++ b/src/DisplayTabs/_AddrEmbedList.py @@ -36,7 +36,7 @@ from gettext import gettext as _ # GRAMPS classes # #------------------------------------------------------------------------- -import RelLib +import gen.lib import Errors from DdTargets import DdTargets from _AddressModel import AddressModel @@ -94,7 +94,7 @@ class AddrEmbedList(EmbeddedList): already exists (Errors.WindowActiveError), we ignore it. This prevents the dialog from coming up twice on the same object. """ - addr = RelLib.Address() + addr = gen.lib.Address() try: from Editors import EditAddress diff --git a/src/DisplayTabs/_AttrEmbedList.py b/src/DisplayTabs/_AttrEmbedList.py index 02f60c56d..11fd674b0 100644 --- a/src/DisplayTabs/_AttrEmbedList.py +++ b/src/DisplayTabs/_AttrEmbedList.py @@ -32,7 +32,7 @@ from gettext import gettext as _ # GRAMPS classes # #------------------------------------------------------------------------- -import RelLib +import gen.lib import Errors from DdTargets import DdTargets from _AttrModel import AttrModel @@ -76,7 +76,7 @@ class AttrEmbedList(EmbeddedList): def add_button_clicked(self, obj): pname = '' - attr = RelLib.Attribute() + attr = gen.lib.Attribute() try: self.get_editor()( self.dbstate, self.uistate, self.track, attr, diff --git a/src/DisplayTabs/_EventEmbedList.py b/src/DisplayTabs/_EventEmbedList.py index faf1e42fb..8bbab9418 100644 --- a/src/DisplayTabs/_EventEmbedList.py +++ b/src/DisplayTabs/_EventEmbedList.py @@ -32,7 +32,7 @@ from gettext import gettext as _ # GRAMPS classes # #------------------------------------------------------------------------- -import RelLib +import gen.lib import Errors from DdTargets import DdTargets from _EmbeddedList import EmbeddedList @@ -84,15 +84,15 @@ class EventEmbedList(EmbeddedList): return ((1, 0), (1, 1), (1, 2), (1, 3), (1, 4), (1, 5)) def default_type(self): - return RelLib.EventType(RelLib.EventType.MARRIAGE) + return gen.lib.EventType(gen.lib.EventType.MARRIAGE) def default_role(self): - return RelLib.EventRoleType(RelLib.EventRoleType.FAMILY) + return gen.lib.EventRoleType(gen.lib.EventRoleType.FAMILY) def add_button_clicked(self, obj): try: - ref = RelLib.EventRef() - event = RelLib.Event() + ref = gen.lib.EventRef() + event = gen.lib.Event() ref.set_role(self.default_role()) event.set_type(self.default_type()) self.get_ref_editor()( @@ -109,7 +109,7 @@ class EventEmbedList(EmbeddedList): event = sel.run() if event: try: - ref = RelLib.EventRef() + ref = gen.lib.EventRef() ref.set_role(self.default_role()) self.get_ref_editor()( self.dbstate, self.uistate, self.track, @@ -151,7 +151,7 @@ class EventEmbedList(EmbeddedList): And event reference that is from a drag and drop has an unknown event reference type """ - from RelLib import EventRoleType + from gen.lib import EventRoleType obj.set_role((EventRoleType.UNKNOWN,'')) EmbeddedList._handle_drag(self, row, obj) @@ -163,7 +163,7 @@ class EventEmbedList(EmbeddedList): def handle_extra_type(self, objtype, obj): try: - ref = RelLib.EventRef() + ref = gen.lib.EventRef() event = self.dbstate.db.get_event_from_handle(obj) ref.set_role(self.default_role()) self.get_ref_editor()( diff --git a/src/DisplayTabs/_FamilyLdsEmbedList.py b/src/DisplayTabs/_FamilyLdsEmbedList.py index 37a3b5489..a40a87667 100644 --- a/src/DisplayTabs/_FamilyLdsEmbedList.py +++ b/src/DisplayTabs/_FamilyLdsEmbedList.py @@ -33,7 +33,7 @@ from gettext import gettext as _ # #------------------------------------------------------------------------- from _LdsEmbedList import LdsEmbedList -import RelLib +import gen.lib #------------------------------------------------------------------------- # @@ -61,6 +61,6 @@ class FamilyLdsEmbedList(LdsEmbedList): return EditFamilyLdsOrd def new_data(self): - lds = RelLib.LdsOrd() - lds.set_type(RelLib.LdsOrd.SEAL_TO_SPOUSE) + lds = gen.lib.LdsOrd() + lds.set_type(gen.lib.LdsOrd.SEAL_TO_SPOUSE) return lds diff --git a/src/DisplayTabs/_GalleryTab.py b/src/DisplayTabs/_GalleryTab.py index a4fa5dd9e..76b49d796 100644 --- a/src/DisplayTabs/_GalleryTab.py +++ b/src/DisplayTabs/_GalleryTab.py @@ -43,7 +43,7 @@ import os # GRAMPS classes # #------------------------------------------------------------------------- -import RelLib +import gen.lib import Utils import ThumbNails import Errors @@ -243,7 +243,7 @@ class GalleryTab(ButtonTab): src = am.object if src: - sref = RelLib.MediaRef() + sref = gen.lib.MediaRef() try: from Editors import EditMediaRef @@ -269,7 +269,7 @@ class GalleryTab(ButtonTab): sel = SelectObject(self.dbstate,self.uistate,self.track) src = sel.run() if src: - sref = RelLib.MediaRef() + sref = gen.lib.MediaRef() try: from Editors import EditMediaRef @@ -410,7 +410,7 @@ class GalleryTab(ButtonTab): self._handle_drag(row, obj) self.rebuild() elif mytype == DdTargets.MEDIAOBJ.drag_type: - oref = RelLib.MediaRef() + oref = gen.lib.MediaRef() oref.set_reference_handle(obj) self.get_data().append(oref) self.changed = True @@ -425,7 +425,7 @@ class GalleryTab(ButtonTab): mime = Mime.get_type(name) if not Mime.is_valid_type(mime): return - photo = RelLib.MediaObject() + photo = gen.lib.MediaObject() photo.set_path(name) photo.set_mime_type(mime) basename = os.path.basename(name) @@ -433,7 +433,7 @@ class GalleryTab(ButtonTab): photo.set_description(root) trans = self.dbstate.db.transaction_begin() self.dbstate.db.add_object(photo, trans) - oref = RelLib.MediaRef() + oref = gen.lib.MediaRef() oref.set_reference_handle(photo.get_handle()) self.get_data().append(oref) self.changed = True @@ -452,14 +452,14 @@ class GalleryTab(ButtonTab): # return # tfile = Utils.fix_encoding(tfile) # mime = GrampsMime.get_type(tfile) -# photo = RelLib.MediaObject() +# photo = gen.lib.MediaObject() # photo.set_mime_type(mime) # photo.set_description(d) # photo.set_path(tfile) # trans = self.db.transaction_begin() # self.db.add_object(photo,trans) # self.db.transaction_commit(trans,_("Drag Media Object")) -# oref = RelLib.MediaRef() +# oref = gen.lib.MediaRef() # oref.set_reference_handle(photo.get_handle()) # self.dataobj.add_media_reference(oref) # self.add_thumbnail(oref) diff --git a/src/DisplayTabs/_LdsEmbedList.py b/src/DisplayTabs/_LdsEmbedList.py index b9f488a28..17932fb16 100644 --- a/src/DisplayTabs/_LdsEmbedList.py +++ b/src/DisplayTabs/_LdsEmbedList.py @@ -32,7 +32,7 @@ from gettext import gettext as _ # GRAMPS classes # #------------------------------------------------------------------------- -import RelLib +import gen.lib import Errors from _LdsModel import LdsModel from _EmbeddedList import EmbeddedList @@ -65,7 +65,7 @@ class LdsEmbedList(EmbeddedList): return EditLdsOrd def new_data(self): - return RelLib.LdsOrd() + return gen.lib.LdsOrd() def get_data(self): return self.data diff --git a/src/DisplayTabs/_LocationEmbedList.py b/src/DisplayTabs/_LocationEmbedList.py index 711b0b5ee..6dbc14a90 100644 --- a/src/DisplayTabs/_LocationEmbedList.py +++ b/src/DisplayTabs/_LocationEmbedList.py @@ -32,7 +32,7 @@ from gettext import gettext as _ # GRAMPS classes # #------------------------------------------------------------------------- -import RelLib +import gen.lib import Errors from DdTargets import DdTargets from _LocationModel import LocationModel @@ -68,7 +68,7 @@ class LocationEmbedList(EmbeddedList): return ((1, 0), (1, 1), (1, 2), (1, 3), (1, 4)) def add_button_clicked(self, obj): - loc = RelLib.Location() + loc = gen.lib.Location() try: from Editors import EditLocation diff --git a/src/DisplayTabs/_NameEmbedList.py b/src/DisplayTabs/_NameEmbedList.py index 4fcb308ac..c27f8fc28 100644 --- a/src/DisplayTabs/_NameEmbedList.py +++ b/src/DisplayTabs/_NameEmbedList.py @@ -39,7 +39,7 @@ from gettext import gettext as _ # GRAMPS classes # #------------------------------------------------------------------------- -import RelLib +import gen.lib import Errors from DdTargets import DdTargets from _NameModel import NameModel @@ -93,7 +93,7 @@ class NameEmbedList(EmbeddedList): self.callback() def add_button_clicked(self, obj): - name = RelLib.Name() + name = gen.lib.Name() try: from Editors import EditName diff --git a/src/DisplayTabs/_NoteTab.py b/src/DisplayTabs/_NoteTab.py index 398b6ac43..4ef0679ad 100644 --- a/src/DisplayTabs/_NoteTab.py +++ b/src/DisplayTabs/_NoteTab.py @@ -42,7 +42,7 @@ import gtk #------------------------------------------------------------------------- import Spell import Errors -import RelLib +import gen.lib from DisplayTabs import log from _NoteModel import NoteModel from _EmbeddedList import EmbeddedList @@ -104,7 +104,7 @@ class NoteTab(EmbeddedList): return ((1, 0), (1, 1)) def add_button_clicked(self, obj): - note = RelLib.Note() + note = gen.lib.Note() if self.notetype : note.set_type(self.notetype) try: diff --git a/src/DisplayTabs/_PersonEventEmbedList.py b/src/DisplayTabs/_PersonEventEmbedList.py index f99baa5c6..c6872cdcc 100644 --- a/src/DisplayTabs/_PersonEventEmbedList.py +++ b/src/DisplayTabs/_PersonEventEmbedList.py @@ -25,12 +25,12 @@ # GRAMPS classes # #------------------------------------------------------------------------- -import RelLib +import gen.lib from _EventEmbedList import EventEmbedList _std_types = [ - RelLib.EventType(RelLib.EventType.BIRTH), - RelLib.EventType(RelLib.EventType.DEATH), + gen.lib.EventType(gen.lib.EventType.BIRTH), + gen.lib.EventType(gen.lib.EventType.DEATH), ] @@ -48,7 +48,7 @@ class PersonEventEmbedList(EventEmbedList): return self.obj.get_event_ref_list() def default_role(self): - return RelLib.EventRoleType(RelLib.EventRoleType.PRIMARY) + return gen.lib.EventRoleType(gen.lib.EventRoleType.PRIMARY) def default_type(self): type_list = [] @@ -62,8 +62,8 @@ class PersonEventEmbedList(EventEmbedList): for etype in _std_types: if etype not in type_list: - return RelLib.EventType(etype) - return RelLib.EventType(RelLib.EventType.BIRTH) + return gen.lib.EventType(etype) + return gen.lib.EventType(gen.lib.EventType.BIRTH) def get_ref_editor(self): from Editors import EditEventRef diff --git a/src/DisplayTabs/_PersonRefEmbedList.py b/src/DisplayTabs/_PersonRefEmbedList.py index 8c2920fd2..c7ec19dc0 100644 --- a/src/DisplayTabs/_PersonRefEmbedList.py +++ b/src/DisplayTabs/_PersonRefEmbedList.py @@ -32,7 +32,7 @@ from gettext import gettext as _ # GRAMPS classes # #------------------------------------------------------------------------- -import RelLib +import gen.lib import Errors from DdTargets import DdTargets from _PersonRefModel import PersonRefModel @@ -73,7 +73,7 @@ class PersonRefEmbedList(EmbeddedList): from Editors import EditPersonRef try: - ref = RelLib.PersonRef() + ref = gen.lib.PersonRef() ref.rel = _('Godfather') EditPersonRef( self.dbstate, self.uistate, self.track, @@ -106,7 +106,7 @@ class PersonRefEmbedList(EmbeddedList): """ try: from Editors import EditPersonRef - ref = RelLib.PersonRef(obj) + ref = gen.lib.PersonRef(obj) ref.rel = _('Unknown') EditPersonRef( self.dbstate, self.uistate, self.track, diff --git a/src/DisplayTabs/_RepoEmbedList.py b/src/DisplayTabs/_RepoEmbedList.py index 1d99a4702..ba5e59043 100644 --- a/src/DisplayTabs/_RepoEmbedList.py +++ b/src/DisplayTabs/_RepoEmbedList.py @@ -32,7 +32,7 @@ from gettext import gettext as _ # GRAMPS classes # #------------------------------------------------------------------------- -import RelLib +import gen.lib import Errors from DdTargets import DdTargets from _RepoRefModel import RepoRefModel @@ -81,7 +81,7 @@ class RepoEmbedList(EmbeddedList): try: from Editors import EditRepoRef - ref = RelLib.RepoRef() + ref = gen.lib.RepoRef() repo = self.dbstate.db.get_repository_from_handle(obj) EditRepoRef( self.dbstate, self.uistate, self.track, @@ -90,8 +90,8 @@ class RepoEmbedList(EmbeddedList): pass def add_button_clicked(self, obj): - ref = RelLib.RepoRef() - repo = RelLib.Repository() + ref = gen.lib.RepoRef() + repo = gen.lib.Repository() try: from Editors import EditRepoRef @@ -116,7 +116,7 @@ class RepoEmbedList(EmbeddedList): try: from Editors import EditRepoRef - ref = RelLib.RepoRef() + ref = gen.lib.RepoRef() EditRepoRef(self.dbstate, self.uistate, self.track, diff --git a/src/DisplayTabs/_SourceEmbedList.py b/src/DisplayTabs/_SourceEmbedList.py index 5ec4ff4d2..129311ebd 100644 --- a/src/DisplayTabs/_SourceEmbedList.py +++ b/src/DisplayTabs/_SourceEmbedList.py @@ -32,7 +32,7 @@ from gettext import gettext as _ # GRAMPS classes # #------------------------------------------------------------------------- -import RelLib +import gen.lib import Errors from DdTargets import DdTargets from _SourceRefModel import SourceRefModel @@ -81,8 +81,8 @@ class SourceEmbedList(EmbeddedList): try: from Editors import EditSourceRef - sref = RelLib.SourceRef() - src = RelLib.Source() + sref = gen.lib.SourceRef() + src = gen.lib.Source() EditSourceRef( self.dbstate, self.uistate, @@ -103,7 +103,7 @@ class SourceEmbedList(EmbeddedList): try: from Editors import EditSourceRef - ref = RelLib.SourceRef() + ref = gen.lib.SourceRef() EditSourceRef(self.dbstate, self.uistate, self.track, @@ -146,7 +146,7 @@ class SourceEmbedList(EmbeddedList): self.rebuild() def handle_extra_type(self, objtype, obj): - sref = RelLib.SourceRef() + sref = gen.lib.SourceRef() src = self.dbstate.db.get_source_from_handle(obj) try: from Editors import EditSourceRef diff --git a/src/DisplayTabs/_WebEmbedList.py b/src/DisplayTabs/_WebEmbedList.py index b9fea490b..760f39f26 100644 --- a/src/DisplayTabs/_WebEmbedList.py +++ b/src/DisplayTabs/_WebEmbedList.py @@ -33,7 +33,7 @@ import gtk # GRAMPS classes # #------------------------------------------------------------------------- -import RelLib +import gen.lib import Errors from DdTargets import DdTargets from _WebModel import WebModel @@ -70,7 +70,7 @@ class WebEmbedList(EmbeddedList): return ((1, 0), (1, 1), (1, 2)) def add_button_clicked(self, obj): - url = RelLib.Url() + url = gen.lib.Url() try: from Editors import EditUrl diff --git a/src/Editors/_EditAddress.py b/src/Editors/_EditAddress.py index edbc650d1..b2c0212ca 100644 --- a/src/Editors/_EditAddress.py +++ b/src/Editors/_EditAddress.py @@ -47,7 +47,7 @@ import gtk.glade import const import Config from _EditSecondary import EditSecondary -from RelLib import NoteType +from gen.lib import NoteType from DisplayTabs import SourceEmbedList, NoteTab from GrampsWidgets import * diff --git a/src/Editors/_EditAttribute.py b/src/Editors/_EditAttribute.py index d269ccb92..2e4884c40 100644 --- a/src/Editors/_EditAttribute.py +++ b/src/Editors/_EditAttribute.py @@ -50,7 +50,7 @@ import gtk.glade import const import Config from _EditSecondary import EditSecondary -from RelLib import NoteType +from gen.lib import NoteType from DisplayTabs import SourceEmbedList, NoteTab from GrampsWidgets import * diff --git a/src/Editors/_EditChildRef.py b/src/Editors/_EditChildRef.py index d282c8e63..50e9c579b 100644 --- a/src/Editors/_EditChildRef.py +++ b/src/Editors/_EditChildRef.py @@ -46,7 +46,7 @@ import gtk.glade #------------------------------------------------------------------------- import const from _EditSecondary import EditSecondary -from RelLib import NoteType +from gen.lib import NoteType from DisplayTabs import SourceEmbedList, NoteTab from GrampsWidgets import * diff --git a/src/Editors/_EditEvent.py b/src/Editors/_EditEvent.py index c86ebe800..c25a53339 100644 --- a/src/Editors/_EditEvent.py +++ b/src/Editors/_EditEvent.py @@ -41,7 +41,7 @@ import gtk #------------------------------------------------------------------------- import const import Config -import RelLib +import gen.lib import GrampsDisplay from _EditPrimary import EditPrimary @@ -73,7 +73,7 @@ class EditEvent(EditPrimary): self.commit_event = self.db.commit_event def empty_object(self): - return RelLib.Event() + return gen.lib.Event() def get_menu_title(self): if self.obj.get_handle(): @@ -167,7 +167,7 @@ class EditEvent(EditPrimary): self.note_tab = self._add_tab( notebook, NoteTab(self.dbstate, self.uistate, self.track, - self.obj.get_note_list(), notetype=RelLib.NoteType.EVENT)) + self.obj.get_note_list(), notetype=gen.lib.NoteType.EVENT)) self.gallery_tab = self._add_tab( notebook, diff --git a/src/Editors/_EditEventRef.py b/src/Editors/_EditEventRef.py index e5e8bf0fb..394cd9b9b 100644 --- a/src/Editors/_EditEventRef.py +++ b/src/Editors/_EditEventRef.py @@ -41,7 +41,7 @@ import gtk #------------------------------------------------------------------------- import const import Config -import RelLib +import gen.lib from DisplayTabs import SourceEmbedList,NoteTab,GalleryTab,EventBackRefList,AttrEmbedList from GrampsWidgets import * @@ -172,13 +172,13 @@ class EditEventRef(EditReference): notebook, NoteTab(self.dbstate, self.uistate, self.track, self.source.get_note_list(), - notetype=RelLib.NoteType.EVENT)) + notetype=gen.lib.NoteType.EVENT)) self.note_ref_tab = self._add_tab( notebook_ref, NoteTab(self.dbstate, self.uistate, self.track, self.source_ref.get_note_list(), - notetype=RelLib.NoteType.EVENTREF)) + notetype=gen.lib.NoteType.EVENTREF)) self.gallery_tab = self._add_tab( notebook, @@ -238,5 +238,5 @@ class EditFamilyEventRef(EditEventRef): self.add_event = self.db.add_family_event def get_custom_events(self): - return [ RelLib.EventType((RelLib.EventType.CUSTOM,val)) \ + return [ gen.lib.EventType((gen.lib.EventType.CUSTOM,val)) \ for val in self.dbstate.db.get_family_event_types()] diff --git a/src/Editors/_EditFamily.py b/src/Editors/_EditFamily.py index f7ecead7e..f76eefe38 100644 --- a/src/Editors/_EditFamily.py +++ b/src/Editors/_EditFamily.py @@ -51,7 +51,7 @@ import gtk import const import Utils from BasicUtils import name_displayer -import RelLib +import gen.lib import Config import Errors @@ -197,7 +197,7 @@ class ChildEmbedList(EmbeddedList): def add_button_clicked(self,obj): from Editors import EditPerson - person = RelLib.Person() + person = gen.lib.Person() autoname = Config.get(Config.SURNAME_GUESSING) if autoname == 0: name = self.north_american() @@ -212,7 +212,7 @@ class ChildEmbedList(EmbeddedList): self.new_child_added) def new_child_added(self, person): - ref = RelLib.ChildRef() + ref = gen.lib.ChildRef() ref.ref = person.get_handle() self.family.add_child_ref(ref) self.rebuild() @@ -232,7 +232,7 @@ class ChildEmbedList(EmbeddedList): person = sel.run() if person: - ref = RelLib.ChildRef() + ref = gen.lib.ChildRef() ref.ref = person.get_handle() self.family.add_child_ref(ref) self.rebuild() @@ -319,7 +319,7 @@ class ChildEmbedList(EmbeddedList): self._move(row_from, row, obj) else: handle = obj - obj = RelLib.ChildRef() + obj = gen.lib.ChildRef() obj.ref = handle self._handle_drag(row, obj) self.rebuild() @@ -363,7 +363,7 @@ class FastMaleFilter: def match(self, handle): value = self.db.get_raw_person_data(handle) - return value[2] == RelLib.Person.MALE + return value[2] == gen.lib.Person.MALE class FastFemaleFilter: @@ -372,7 +372,7 @@ class FastFemaleFilter: def match(self, handle): value = self.db.get_raw_person_data(handle) - return value[2] == RelLib.Person.FEMALE + return value[2] == gen.lib.Person.FEMALE #------------------------------------------------------------------------- # @@ -413,7 +413,7 @@ class EditFamily(EditPrimary): self.add_parent = False def empty_object(self): - return RelLib.Family() + return gen.lib.Family() def _local_init(self): self.build_interface() @@ -581,7 +581,7 @@ class EditFamily(EditPrimary): notebook, NoteTab(self.dbstate, self.uistate, self.track, self.obj.get_note_list(), self.get_menu_title(), - notetype=RelLib.NoteType.FAMILY)) + notetype=gen.lib.NoteType.FAMILY)) self.gallery_tab = self._add_tab( notebook, @@ -612,15 +612,15 @@ class EditFamily(EditPrimary): def add_mother_clicked(self, obj): from Editors import EditPerson - person = RelLib.Person() - person.set_gender(RelLib.Person.FEMALE) + person = gen.lib.Person() + person.set_gender(gen.lib.Person.FEMALE) EditPerson(self.dbstate, self.uistate, self.track, person, self.new_mother_added) def add_father_clicked(self, obj): from Editors import EditPerson - person = RelLib.Person() - person.set_gender(RelLib.Person.MALE) + person = gen.lib.Person() + person.set_gender(gen.lib.Person.MALE) EditPerson(self.dbstate, self.uistate, self.track, person, self.new_father_added) @@ -662,7 +662,7 @@ class EditFamily(EditPrimary): self.update_mother(person.handle) def on_change_father(self, selector_window, obj): - if obj.__class__ == RelLib.Person: + if obj.__class__ == gen.lib.Person: try: person = obj self.obj.set_father_handle(person.get_handle()) @@ -677,7 +677,7 @@ class EditFamily(EditPrimary): log.warn( "Object selector returned obj.__class__ = %s, it should " "have been of type %s." % (obj.__class__.__name__, - RelLib.Person.__name__)) + gen.lib.Person.__name__)) selector_window.close() diff --git a/src/Editors/_EditLdsOrd.py b/src/Editors/_EditLdsOrd.py index 36a9e0f2b..700451089 100644 --- a/src/Editors/_EditLdsOrd.py +++ b/src/Editors/_EditLdsOrd.py @@ -49,7 +49,7 @@ import gtk.glade #------------------------------------------------------------------------- import const import Config -import RelLib +import gen.lib from BasicUtils import name_displayer import LdsUtils @@ -59,65 +59,65 @@ from DisplayTabs import SourceEmbedList,NoteTab from GrampsWidgets import * _DATA_MAP = { - RelLib.LdsOrd.BAPTISM : [ - RelLib.LdsOrd.STATUS_NONE, - RelLib.LdsOrd.STATUS_CHILD, - RelLib.LdsOrd.STATUS_CLEARED, - RelLib.LdsOrd.STATUS_COMPLETED, - RelLib.LdsOrd.STATUS_INFANT, - RelLib.LdsOrd.STATUS_PRE_1970, - RelLib.LdsOrd.STATUS_QUALIFIED, - RelLib.LdsOrd.STATUS_STILLBORN, - RelLib.LdsOrd.STATUS_SUBMITTED, - RelLib.LdsOrd.STATUS_UNCLEARED, + gen.lib.LdsOrd.BAPTISM : [ + gen.lib.LdsOrd.STATUS_NONE, + gen.lib.LdsOrd.STATUS_CHILD, + gen.lib.LdsOrd.STATUS_CLEARED, + gen.lib.LdsOrd.STATUS_COMPLETED, + gen.lib.LdsOrd.STATUS_INFANT, + gen.lib.LdsOrd.STATUS_PRE_1970, + gen.lib.LdsOrd.STATUS_QUALIFIED, + gen.lib.LdsOrd.STATUS_STILLBORN, + gen.lib.LdsOrd.STATUS_SUBMITTED, + gen.lib.LdsOrd.STATUS_UNCLEARED, ], - RelLib.LdsOrd.CONFIRMATION : [ - RelLib.LdsOrd.STATUS_NONE, - RelLib.LdsOrd.STATUS_CHILD, - RelLib.LdsOrd.STATUS_CLEARED, - RelLib.LdsOrd.STATUS_COMPLETED, - RelLib.LdsOrd.STATUS_INFANT, - RelLib.LdsOrd.STATUS_PRE_1970, - RelLib.LdsOrd.STATUS_QUALIFIED, - RelLib.LdsOrd.STATUS_STILLBORN, - RelLib.LdsOrd.STATUS_SUBMITTED, - RelLib.LdsOrd.STATUS_UNCLEARED, + gen.lib.LdsOrd.CONFIRMATION : [ + gen.lib.LdsOrd.STATUS_NONE, + gen.lib.LdsOrd.STATUS_CHILD, + gen.lib.LdsOrd.STATUS_CLEARED, + gen.lib.LdsOrd.STATUS_COMPLETED, + gen.lib.LdsOrd.STATUS_INFANT, + gen.lib.LdsOrd.STATUS_PRE_1970, + gen.lib.LdsOrd.STATUS_QUALIFIED, + gen.lib.LdsOrd.STATUS_STILLBORN, + gen.lib.LdsOrd.STATUS_SUBMITTED, + gen.lib.LdsOrd.STATUS_UNCLEARED, ], - RelLib.LdsOrd.ENDOWMENT: [ - RelLib.LdsOrd.STATUS_NONE, - RelLib.LdsOrd.STATUS_CHILD, - RelLib.LdsOrd.STATUS_CLEARED, - RelLib.LdsOrd.STATUS_COMPLETED, - RelLib.LdsOrd.STATUS_INFANT, - RelLib.LdsOrd.STATUS_PRE_1970, - RelLib.LdsOrd.STATUS_QUALIFIED, - RelLib.LdsOrd.STATUS_STILLBORN, - RelLib.LdsOrd.STATUS_SUBMITTED, - RelLib.LdsOrd.STATUS_UNCLEARED, + gen.lib.LdsOrd.ENDOWMENT: [ + gen.lib.LdsOrd.STATUS_NONE, + gen.lib.LdsOrd.STATUS_CHILD, + gen.lib.LdsOrd.STATUS_CLEARED, + gen.lib.LdsOrd.STATUS_COMPLETED, + gen.lib.LdsOrd.STATUS_INFANT, + gen.lib.LdsOrd.STATUS_PRE_1970, + gen.lib.LdsOrd.STATUS_QUALIFIED, + gen.lib.LdsOrd.STATUS_STILLBORN, + gen.lib.LdsOrd.STATUS_SUBMITTED, + gen.lib.LdsOrd.STATUS_UNCLEARED, ], - RelLib.LdsOrd.SEAL_TO_PARENTS:[ - RelLib.LdsOrd.STATUS_NONE, - RelLib.LdsOrd.STATUS_BIC, - RelLib.LdsOrd.STATUS_CLEARED, - RelLib.LdsOrd.STATUS_COMPLETED, - RelLib.LdsOrd.STATUS_DNS, - RelLib.LdsOrd.STATUS_PRE_1970, - RelLib.LdsOrd.STATUS_QUALIFIED, - RelLib.LdsOrd.STATUS_STILLBORN, - RelLib.LdsOrd.STATUS_SUBMITTED, - RelLib.LdsOrd.STATUS_UNCLEARED, + gen.lib.LdsOrd.SEAL_TO_PARENTS:[ + gen.lib.LdsOrd.STATUS_NONE, + gen.lib.LdsOrd.STATUS_BIC, + gen.lib.LdsOrd.STATUS_CLEARED, + gen.lib.LdsOrd.STATUS_COMPLETED, + gen.lib.LdsOrd.STATUS_DNS, + gen.lib.LdsOrd.STATUS_PRE_1970, + gen.lib.LdsOrd.STATUS_QUALIFIED, + gen.lib.LdsOrd.STATUS_STILLBORN, + gen.lib.LdsOrd.STATUS_SUBMITTED, + gen.lib.LdsOrd.STATUS_UNCLEARED, ], - RelLib.LdsOrd.SEAL_TO_SPOUSE :[ - RelLib.LdsOrd.STATUS_NONE, - RelLib.LdsOrd.STATUS_CANCELED, - RelLib.LdsOrd.STATUS_CLEARED, - RelLib.LdsOrd.STATUS_COMPLETED, - RelLib.LdsOrd.STATUS_DNS, - RelLib.LdsOrd.STATUS_PRE_1970, - RelLib.LdsOrd.STATUS_QUALIFIED, - RelLib.LdsOrd.STATUS_DNS_CAN, - RelLib.LdsOrd.STATUS_SUBMITTED, - RelLib.LdsOrd.STATUS_UNCLEARED, + gen.lib.LdsOrd.SEAL_TO_SPOUSE :[ + gen.lib.LdsOrd.STATUS_NONE, + gen.lib.LdsOrd.STATUS_CANCELED, + gen.lib.LdsOrd.STATUS_CLEARED, + gen.lib.LdsOrd.STATUS_COMPLETED, + gen.lib.LdsOrd.STATUS_DNS, + gen.lib.LdsOrd.STATUS_PRE_1970, + gen.lib.LdsOrd.STATUS_QUALIFIED, + gen.lib.LdsOrd.STATUS_DNS_CAN, + gen.lib.LdsOrd.STATUS_SUBMITTED, + gen.lib.LdsOrd.STATUS_UNCLEARED, ], } @@ -160,10 +160,10 @@ class EditLdsOrd(EditSecondary): self.define_ok_button(self.top.get_widget('ok'),self.save) def _get_types(self): - return (RelLib.LdsOrd.BAPTISM, - RelLib.LdsOrd.ENDOWMENT, - RelLib.LdsOrd.CONFIRMATION, - RelLib.LdsOrd.SEAL_TO_PARENTS) + return (gen.lib.LdsOrd.BAPTISM, + gen.lib.LdsOrd.ENDOWMENT, + gen.lib.LdsOrd.CONFIRMATION, + gen.lib.LdsOrd.SEAL_TO_PARENTS) def _setup_fields(self): @@ -197,7 +197,7 @@ class EditLdsOrd(EditSecondary): self.top.get_widget('type'), self.obj.set_type, self.obj.get_type, - [(item[1],item[0]) for item in RelLib.LdsOrd._TYPE_MAP + [(item[1],item[0]) for item in gen.lib.LdsOrd._TYPE_MAP if item[0] in self._get_types()], self.db.readonly, changed=self.ord_type_changed) @@ -213,7 +213,7 @@ class EditLdsOrd(EditSecondary): self.top.get_widget('status'), self.obj.set_status, self.obj.get_status, - [(item[1],item[0]) for item in RelLib.LdsOrd._STATUS_MAP + [(item[1],item[0]) for item in gen.lib.LdsOrd._STATUS_MAP if item[0] in _DATA_MAP[self.obj.get_type()] ], self.db.readonly) @@ -221,19 +221,19 @@ class EditLdsOrd(EditSecondary): self.update_parent_label() def ord_type_changed(self): - if self.obj.get_type() == RelLib.LdsOrd.BAPTISM: + if self.obj.get_type() == gen.lib.LdsOrd.BAPTISM: self.parents.hide() self.parents_label.hide() self.parents_select.hide() - elif self.obj.get_type() == RelLib.LdsOrd.ENDOWMENT: + elif self.obj.get_type() == gen.lib.LdsOrd.ENDOWMENT: self.parents.hide() self.parents_label.hide() self.parents_select.hide() - elif self.obj.get_type() == RelLib.LdsOrd.SEAL_TO_PARENTS: + elif self.obj.get_type() == gen.lib.LdsOrd.SEAL_TO_PARENTS: self.parents.show() self.parents_label.show() self.parents_select.show() - new_data = [(item[1],item[0]) for item in RelLib.LdsOrd._STATUS_MAP + new_data = [(item[1],item[0]) for item in gen.lib.LdsOrd._STATUS_MAP if item[0] in _DATA_MAP[self.obj.get_type()] ] self.status_menu.change_menu(new_data) @@ -247,7 +247,7 @@ class EditLdsOrd(EditSecondary): notebook, NoteTab(self.dbstate, self.uistate, self.track, self.obj.get_note_list(), - notetype=RelLib.NoteType.LDS)) + notetype=gen.lib.NoteType.LDS)) self._setup_notebook_tabs( notebook) notebook.show_all() @@ -345,7 +345,7 @@ class EditFamilyLdsOrd(EditSecondary): self.define_ok_button(self.top.get_widget('ok'),self.save) def _get_types(self): - return (RelLib.LdsOrd.SEAL_TO_SPOUSE,) + return (gen.lib.LdsOrd.SEAL_TO_SPOUSE,) def _setup_fields(self): @@ -379,7 +379,7 @@ class EditFamilyLdsOrd(EditSecondary): self.top.get_widget('type'), self.obj.set_type, self.obj.get_type, - [(item[1],item[0]) for item in RelLib.LdsOrd._TYPE_MAP + [(item[1],item[0]) for item in gen.lib.LdsOrd._TYPE_MAP if item[0] in self._get_types()], self.db.readonly) @@ -394,7 +394,7 @@ class EditFamilyLdsOrd(EditSecondary): self.top.get_widget('status'), self.obj.set_status, self.obj.get_status, - [(item[1],item[0]) for item in RelLib.LdsOrd._STATUS_MAP + [(item[1],item[0]) for item in gen.lib.LdsOrd._STATUS_MAP if item[0] in _DATA_MAP[self.obj.get_type()]], self.db.readonly) @@ -408,7 +408,7 @@ class EditFamilyLdsOrd(EditSecondary): notebook, NoteTab(self.dbstate, self.uistate, self.track, self.obj.get_note_list(), - notetype=RelLib.NoteType.LDS)) + notetype=gen.lib.NoteType.LDS)) notebook.show_all() self.top.get_widget('vbox').pack_start(notebook,True) diff --git a/src/Editors/_EditMedia.py b/src/Editors/_EditMedia.py index fa5ee2bb0..2b4f84dac 100644 --- a/src/Editors/_EditMedia.py +++ b/src/Editors/_EditMedia.py @@ -43,7 +43,7 @@ import gtk #------------------------------------------------------------------------- import const import Config -import RelLib +import gen.lib import Mime import ThumbNails from _EditPrimary import EditPrimary @@ -64,7 +64,7 @@ class EditMedia(EditPrimary): state.db.get_object_from_handle) def empty_object(self): - return RelLib.MediaObject() + return gen.lib.MediaObject() def get_menu_title(self): if self.obj.get_handle(): @@ -156,13 +156,13 @@ class EditMedia(EditPrimary): notebook, NoteTab(self.dbstate, self.uistate, self.track, self.obj.get_note_list(), - notetype=RelLib.NoteType.MEDIA)) + notetype=gen.lib.NoteType.MEDIA)) else: self.note_tab = self._add_tab( notebook, NoteTab(self.dbstate, self.uistate, self.track, self.obj.get_note_list(), - notetype=RelLib.NoteType.MEDIA)) + notetype=gen.lib.NoteType.MEDIA)) self.src_list = self._add_tab( notebook, diff --git a/src/Editors/_EditMediaRef.py b/src/Editors/_EditMediaRef.py index 685b4bc37..743c98e24 100644 --- a/src/Editors/_EditMediaRef.py +++ b/src/Editors/_EditMediaRef.py @@ -43,7 +43,7 @@ import const import Config import Mime import ThumbNails -from RelLib import NoteType +from gen.lib import NoteType from DisplayTabs import \ SourceEmbedList,AttrEmbedList,MediaBackRefList,NoteTab diff --git a/src/Editors/_EditName.py b/src/Editors/_EditName.py index c949ee6ef..f7f2b4113 100644 --- a/src/Editors/_EditName.py +++ b/src/Editors/_EditName.py @@ -44,7 +44,7 @@ import Config import Utils from BasicUtils import name_displayer from _EditSecondary import EditSecondary -from RelLib import NoteType +from gen.lib import NoteType from DisplayTabs import SourceEmbedList,NoteTab from GrampsWidgets import * diff --git a/src/Editors/_EditNote.py b/src/Editors/_EditNote.py index 495b4ebbf..97bd9f5ff 100644 --- a/src/Editors/_EditNote.py +++ b/src/Editors/_EditNote.py @@ -47,7 +47,7 @@ import GrampsDisplay import MarkupText from _EditPrimary import EditPrimary from GrampsWidgets import * -from RelLib import Note +from gen.lib import Note #------------------------------------------------------------------------- # diff --git a/src/Editors/_EditPerson.py b/src/Editors/_EditPerson.py index 910b80e84..c66126c11 100644 --- a/src/Editors/_EditPerson.py +++ b/src/Editors/_EditPerson.py @@ -51,7 +51,7 @@ import gtk import const import Utils import Mime -import RelLib +import gen.lib import GrampsWidgets from BasicUtils import name_displayer import Errors @@ -101,7 +101,7 @@ class EditPerson(EditPrimary): Returns an empty Person object for comparison for changes. This is used by the base class (EditPrimary) """ - return RelLib.Person() + return gen.lib.Person() def get_menu_title(self): if self.obj.get_handle(): @@ -120,7 +120,7 @@ class EditPerson(EditPrimary): self.pname = self.obj.get_primary_name() self.should_guess_gender = (not self.obj.get_gramps_id() and self.obj.get_gender () == - RelLib.Person.UNKNOWN) + gen.lib.Person.UNKNOWN) self.load_obj = None self.load_rect = None @@ -203,9 +203,9 @@ class EditPerson(EditPrimary): self.obj.set_gender, self.obj.get_gender, ( - (_('female'), RelLib.Person.FEMALE), - (_('male'), RelLib.Person.MALE), - (_('unknown'), RelLib.Person.UNKNOWN) + (_('female'), gen.lib.Person.FEMALE), + (_('male'), gen.lib.Person.MALE), + (_('unknown'), gen.lib.Person.UNKNOWN) ), self.db.readonly) @@ -315,7 +315,7 @@ class EditPerson(EditPrimary): notebook, NoteTab(self.dbstate, self.uistate, self.track, self.obj.get_note_list(), self.get_menu_title(), - notetype=RelLib.NoteType.PERSON)) + notetype=gen.lib.NoteType.PERSON)) self.gallery_tab = self._add_tab( notebook, @@ -561,7 +561,7 @@ class EditPerson(EditPrimary): self.obj_photo.hide() def _check_for_unknown_gender(self): - if self.obj.get_gender() == RelLib.Person.UNKNOWN: + if self.obj.get_gender() == gen.lib.Person.UNKNOWN: d = GenderDialog(self.window) gender = d.run() d.destroy() @@ -604,7 +604,7 @@ class EditPerson(EditPrimary): if original: (female, male, unknown) = _select_gender[self.obj.get_gender()] - if male and original.get_gender() != RelLib.Person.MALE: + if male and original.get_gender() != gen.lib.Person.MALE: for tmp_handle in self.obj.get_family_handle_list(): temp_family = self.db.get_family_from_handle(tmp_handle) if self.obj == temp_family.get_mother_handle(): @@ -613,7 +613,7 @@ class EditPerson(EditPrimary): else: temp_family.set_mother_handle(None) temp_family.set_father_handle(self.obj) - elif female and original != RelLib.Person.FEMALE: + elif female and original != gen.lib.Person.FEMALE: for tmp_handle in self.obj.get_family_handle_list(): temp_family = self.db.get_family_from_handle(tmp_handle) if self.obj == temp_family.get_father_handle(): @@ -622,7 +622,7 @@ class EditPerson(EditPrimary): else: temp_family.set_father_handle(None) temp_family.set_mother_handle(self.obj) - elif unknown and original.get_gender() != RelLib.Person.UNKNOWN: + elif unknown and original.get_gender() != gen.lib.Person.UNKNOWN: for tmp_handle in self.obj.get_family_handle_list(): temp_family = self.db.get_family_from_handle(tmp_handle) if self.obj == temp_family.get_father_handle(): @@ -821,6 +821,6 @@ class GenderDialog(gtk.MessageDialog): _("The gender of the person is currently unknown. " "Usually, this is a mistake. Please specify the gender.")) - self.add_button(_('Male'), RelLib.Person.MALE) - self.add_button(_('Female'), RelLib.Person.FEMALE) - self.add_button(_('Unknown'), RelLib.Person.UNKNOWN) + self.add_button(_('Male'), gen.lib.Person.MALE) + self.add_button(_('Female'), gen.lib.Person.FEMALE) + self.add_button(_('Unknown'), gen.lib.Person.UNKNOWN) diff --git a/src/Editors/_EditPersonRef.py b/src/Editors/_EditPersonRef.py index 49e6cffcc..500266ef9 100644 --- a/src/Editors/_EditPersonRef.py +++ b/src/Editors/_EditPersonRef.py @@ -48,7 +48,7 @@ import const import Config from BasicUtils import name_displayer from _EditSecondary import EditSecondary -from RelLib import NoteType +from gen.lib import NoteType from DisplayTabs import SourceEmbedList, NoteTab from GrampsWidgets import * diff --git a/src/Editors/_EditPlace.py b/src/Editors/_EditPlace.py index 525e8c0f3..67c7b2ee3 100644 --- a/src/Editors/_EditPlace.py +++ b/src/Editors/_EditPlace.py @@ -44,7 +44,7 @@ import gtk #------------------------------------------------------------------------- import const import Config -import RelLib +import gen.lib from _EditPrimary import EditPrimary from DisplayTabs import * @@ -63,7 +63,7 @@ class EditPlace(EditPrimary): dbstate.db.get_place_from_handle, callback) def empty_object(self): - return RelLib.Place() + return gen.lib.Place() def _local_init(self): self.top = gtk.glade.XML(const.GLADE_FILE,"place_editor","gramps") @@ -180,7 +180,7 @@ class EditPlace(EditPrimary): notebook, NoteTab(self.dbstate, self.uistate, self.track, self.obj.get_note_list(), self.get_menu_title(), - notetype=RelLib.NoteType.PLACE)) + notetype=gen.lib.NoteType.PLACE)) self.gallery_tab = self._add_tab( notebook, diff --git a/src/Editors/_EditRepoRef.py b/src/Editors/_EditRepoRef.py index 1380d37d5..281458cba 100644 --- a/src/Editors/_EditRepoRef.py +++ b/src/Editors/_EditRepoRef.py @@ -42,7 +42,7 @@ import gtk import const import Config -from RelLib import NoteType +from gen.lib import NoteType from DisplayTabs import NoteTab,AddrEmbedList,WebEmbedList,SourceBackRefList from GrampsWidgets import * diff --git a/src/Editors/_EditRepository.py b/src/Editors/_EditRepository.py index 941c4cdd1..5aaa043a7 100644 --- a/src/Editors/_EditRepository.py +++ b/src/Editors/_EditRepository.py @@ -41,7 +41,7 @@ import gtk #------------------------------------------------------------------------- import const import Config -import RelLib +import gen.lib from GrampsWidgets import * from DisplayTabs import AddrEmbedList,WebEmbedList,NoteTab,SourceBackRefList @@ -55,7 +55,7 @@ class EditRepository(EditPrimary): repository, dbstate.db.get_repository_from_handle) def empty_object(self): - return RelLib.Repository() + return gen.lib.Repository() def get_menu_title(self): if self.obj.get_handle(): @@ -125,7 +125,7 @@ class EditRepository(EditPrimary): notebook, NoteTab(self.dbstate, self.uistate, self.track, self.obj.get_note_list(), self.get_menu_title(), - notetype=RelLib.NoteType.REPO)) + notetype=gen.lib.NoteType.REPO)) self.backref_tab = self._add_tab( notebook, diff --git a/src/Editors/_EditSource.py b/src/Editors/_EditSource.py index f8df6034f..9b58cf979 100644 --- a/src/Editors/_EditSource.py +++ b/src/Editors/_EditSource.py @@ -44,7 +44,7 @@ import gtk.glade #------------------------------------------------------------------------- import const import Config -import RelLib +import gen.lib from _EditPrimary import EditPrimary from DisplayTabs import \ @@ -64,7 +64,7 @@ class EditSource(EditPrimary): source, dbstate.db.get_source_from_handle) def empty_object(self): - return RelLib.Source() + return gen.lib.Source() def get_menu_title(self): title = self.obj.get_title() @@ -131,7 +131,7 @@ class EditSource(EditPrimary): notebook, NoteTab(self.dbstate, self.uistate, self.track, self.obj.get_note_list(), self.get_menu_title(), - RelLib.NoteType.SOURCE)) + gen.lib.NoteType.SOURCE)) self.gallery_tab = self._add_tab( notebook, diff --git a/src/Editors/_EditSourceRef.py b/src/Editors/_EditSourceRef.py index 8a9afef76..5b8e69b8f 100644 --- a/src/Editors/_EditSourceRef.py +++ b/src/Editors/_EditSourceRef.py @@ -40,7 +40,7 @@ import gtk # #------------------------------------------------------------------------- import const -import RelLib +import gen.lib from DisplayTabs import \ NoteTab,TextTab,GalleryTab,SourceBackRefList,DataEmbedList,RepoEmbedList @@ -112,11 +112,11 @@ class EditSourceRef(EditReference): self.top.get_widget('confidence'), self.source_ref.set_confidence_level, self.source_ref.get_confidence_level, [ - (_('Very Low'), RelLib.SourceRef.CONF_VERY_LOW), - (_('Low'), RelLib.SourceRef.CONF_LOW), - (_('Normal'), RelLib.SourceRef.CONF_NORMAL), - (_('High'), RelLib.SourceRef.CONF_HIGH), - (_('Very High'), RelLib.SourceRef.CONF_VERY_HIGH)], + (_('Very Low'), gen.lib.SourceRef.CONF_VERY_LOW), + (_('Low'), gen.lib.SourceRef.CONF_LOW), + (_('Normal'), gen.lib.SourceRef.CONF_NORMAL), + (_('High'), gen.lib.SourceRef.CONF_HIGH), + (_('Very High'), gen.lib.SourceRef.CONF_VERY_HIGH)], self.db.readonly) self.date = MonitoredDate( @@ -141,7 +141,7 @@ class EditSourceRef(EditReference): notebook_src, NoteTab(self.dbstate, self.uistate, self.track, self.source.get_note_list(), - notetype=RelLib.NoteType.SOURCE)) + notetype=gen.lib.NoteType.SOURCE)) self.gallery_tab = self._add_tab( notebook_src, @@ -173,7 +173,7 @@ class EditSourceRef(EditReference): notebook_ref, NoteTab(self.dbstate, self.uistate, self.track, self.source_ref.get_note_list(), - notetype=RelLib.NoteType.SOURCEREF)) + notetype=gen.lib.NoteType.SOURCEREF)) self._setup_notebook_tabs( notebook_src) self._setup_notebook_tabs( notebook_ref) diff --git a/src/FilterEditor/_EditRule.py b/src/FilterEditor/_EditRule.py index b9b05bce2..8509592fe 100644 --- a/src/FilterEditor/_EditRule.py +++ b/src/FilterEditor/_EditRule.py @@ -56,7 +56,7 @@ import gobject #------------------------------------------------------------------------- import GrampsDisplay import const -import RelLib +import gen.lib from Filters import Rules import AutoComp from Selectors import selector_factory @@ -78,14 +78,14 @@ def by_rule_name(f,s): # #------------------------------------------------------------------------- _name2typeclass = { - _('Personal event:') : RelLib.EventType, - _('Family event:') : RelLib.EventType, - _('Event type:') : RelLib.EventType, - _('Personal attribute:') : RelLib.AttributeType, - _('Family attribute:') : RelLib.AttributeType, - _('Relationship type:') : RelLib.FamilyRelType, - _('Marker type:') : RelLib.MarkerType, - _('Note type:') : RelLib.NoteType, + _('Personal event:') : gen.lib.EventType, + _('Family event:') : gen.lib.EventType, + _('Event type:') : gen.lib.EventType, + _('Personal attribute:') : gen.lib.AttributeType, + _('Family attribute:') : gen.lib.AttributeType, + _('Relationship type:') : gen.lib.FamilyRelType, + _('Marker type:') : gen.lib.MarkerType, + _('Note type:') : gen.lib.NoteType, } #------------------------------------------------------------------------- diff --git a/src/Filters/Rules/Event/_HasType.py b/src/Filters/Rules/Event/_HasType.py index bfe846c19..313b9ca59 100644 --- a/src/Filters/Rules/Event/_HasType.py +++ b/src/Filters/Rules/Event/_HasType.py @@ -32,7 +32,7 @@ from gettext import gettext as _ # GRAMPS modules # #------------------------------------------------------------------------- -from RelLib import EventType +from gen.lib import EventType from Filters.Rules._Rule import Rule #------------------------------------------------------------------------- diff --git a/src/Filters/Rules/Family/_HasRelType.py b/src/Filters/Rules/Family/_HasRelType.py index 3ffcc9801..643a8429d 100644 --- a/src/Filters/Rules/Family/_HasRelType.py +++ b/src/Filters/Rules/Family/_HasRelType.py @@ -32,7 +32,7 @@ from gettext import gettext as _ # GRAMPS modules # #------------------------------------------------------------------------- -from RelLib import FamilyRelType +from gen.lib import FamilyRelType from Filters.Rules._Rule import Rule #------------------------------------------------------------------------- diff --git a/src/Filters/Rules/Note/_HasNote.py b/src/Filters/Rules/Note/_HasNote.py index 20a03833a..d4366998b 100644 --- a/src/Filters/Rules/Note/_HasNote.py +++ b/src/Filters/Rules/Note/_HasNote.py @@ -32,7 +32,7 @@ from gettext import gettext as _ # GRAMPS modules # #------------------------------------------------------------------------- -from RelLib import NoteType +from gen.lib import NoteType from Filters.Rules._Rule import Rule #------------------------------------------------------------------------- diff --git a/src/Filters/Rules/Person/_HasBirth.py b/src/Filters/Rules/Person/_HasBirth.py index c978f565b..1afbe1ff2 100644 --- a/src/Filters/Rules/Person/_HasBirth.py +++ b/src/Filters/Rules/Person/_HasBirth.py @@ -33,7 +33,7 @@ from gettext import gettext as _ # #------------------------------------------------------------------------- import DateHandler -from RelLib import EventType,EventRoleType +from gen.lib import EventType,EventRoleType from Filters.Rules._Rule import Rule #------------------------------------------------------------------------- diff --git a/src/Filters/Rules/Person/_HasCompleteRecord.py b/src/Filters/Rules/Person/_HasCompleteRecord.py index 1c5c5bb08..64c4038f4 100644 --- a/src/Filters/Rules/Person/_HasCompleteRecord.py +++ b/src/Filters/Rules/Person/_HasCompleteRecord.py @@ -33,7 +33,7 @@ from gettext import gettext as _ # #------------------------------------------------------------------------- from Filters.Rules._Rule import Rule -from RelLib import MarkerType +from gen.lib import MarkerType #------------------------------------------------------------------------- # diff --git a/src/Filters/Rules/Person/_HasDeath.py b/src/Filters/Rules/Person/_HasDeath.py index d2e725c89..c54375b11 100644 --- a/src/Filters/Rules/Person/_HasDeath.py +++ b/src/Filters/Rules/Person/_HasDeath.py @@ -33,7 +33,7 @@ from gettext import gettext as _ # #------------------------------------------------------------------------- import DateHandler -from RelLib import EventType,EventRoleType +from gen.lib import EventType,EventRoleType from Filters.Rules._Rule import Rule #------------------------------------------------------------------------- diff --git a/src/Filters/Rules/Person/_HasEvent.py b/src/Filters/Rules/Person/_HasEvent.py index 0a68a07b0..b4ea4fe82 100644 --- a/src/Filters/Rules/Person/_HasEvent.py +++ b/src/Filters/Rules/Person/_HasEvent.py @@ -32,7 +32,7 @@ from gettext import gettext as _ # GRAMPS modules # #------------------------------------------------------------------------- -from RelLib import EventRoleType +from gen.lib import EventRoleType from Filters.Rules._HasEventBase import HasEventBase #------------------------------------------------------------------------- diff --git a/src/Filters/Rules/Person/_HasFamilyEvent.py b/src/Filters/Rules/Person/_HasFamilyEvent.py index cafef9f1f..648487a4b 100644 --- a/src/Filters/Rules/Person/_HasFamilyEvent.py +++ b/src/Filters/Rules/Person/_HasFamilyEvent.py @@ -33,7 +33,7 @@ from gettext import gettext as _ # #------------------------------------------------------------------------- import DateHandler -from RelLib import EventType +from gen.lib import EventType from Filters.Rules._Rule import Rule #------------------------------------------------------------------------- diff --git a/src/Filters/Rules/Person/_HasRelationship.py b/src/Filters/Rules/Person/_HasRelationship.py index 0d4cbf1d4..736c486cd 100644 --- a/src/Filters/Rules/Person/_HasRelationship.py +++ b/src/Filters/Rules/Person/_HasRelationship.py @@ -33,7 +33,7 @@ from gettext import gettext as _ # #------------------------------------------------------------------------- from Filters.Rules._Rule import Rule -from RelLib import FamilyRelType +from gen.lib import FamilyRelType #------------------------------------------------------------------------- # diff --git a/src/Filters/Rules/Person/_HasUnknownGender.py b/src/Filters/Rules/Person/_HasUnknownGender.py index 41698090e..2147190cc 100644 --- a/src/Filters/Rules/Person/_HasUnknownGender.py +++ b/src/Filters/Rules/Person/_HasUnknownGender.py @@ -33,7 +33,7 @@ from gettext import gettext as _ # #------------------------------------------------------------------------- from Filters.Rules._Rule import Rule -from RelLib import Person +from gen.lib import Person #------------------------------------------------------------------------- # diff --git a/src/Filters/Rules/Person/_HaveAltFamilies.py b/src/Filters/Rules/Person/_HaveAltFamilies.py index f9c37e189..df2e0b0d2 100644 --- a/src/Filters/Rules/Person/_HaveAltFamilies.py +++ b/src/Filters/Rules/Person/_HaveAltFamilies.py @@ -33,7 +33,7 @@ from gettext import gettext as _ # #------------------------------------------------------------------------- from Filters.Rules._Rule import Rule -from RelLib import ChildRefType +from gen.lib import ChildRefType #------------------------------------------------------------------------- # "People who were adopted" diff --git a/src/Filters/Rules/Person/_IsFemale.py b/src/Filters/Rules/Person/_IsFemale.py index 5ba24530a..a5f1e6dfa 100644 --- a/src/Filters/Rules/Person/_IsFemale.py +++ b/src/Filters/Rules/Person/_IsFemale.py @@ -33,7 +33,7 @@ from gettext import gettext as _ # #------------------------------------------------------------------------- from Filters.Rules._Rule import Rule -from RelLib import Person +from gen.lib import Person #------------------------------------------------------------------------- # diff --git a/src/Filters/Rules/Person/_IsMale.py b/src/Filters/Rules/Person/_IsMale.py index bbd08a9ac..466502959 100644 --- a/src/Filters/Rules/Person/_IsMale.py +++ b/src/Filters/Rules/Person/_IsMale.py @@ -33,7 +33,7 @@ from gettext import gettext as _ # #------------------------------------------------------------------------- from Filters.Rules._Rule import Rule -from RelLib import Person +from gen.lib import Person #------------------------------------------------------------------------- # diff --git a/src/Filters/Rules/Person/_IsWitness.py b/src/Filters/Rules/Person/_IsWitness.py index b8bd4128f..88d4aa3a5 100644 --- a/src/Filters/Rules/Person/_IsWitness.py +++ b/src/Filters/Rules/Person/_IsWitness.py @@ -33,7 +33,7 @@ from gettext import gettext as _ # #------------------------------------------------------------------------- from Filters.Rules._Rule import Rule -from RelLib import EventRoleType, EventType +from gen.lib import EventRoleType, EventType #------------------------------------------------------------------------- # "Witnesses" diff --git a/src/Filters/Rules/Repository/_HasRepo.py b/src/Filters/Rules/Repository/_HasRepo.py index e40a3f8a9..ebe5afb83 100644 --- a/src/Filters/Rules/Repository/_HasRepo.py +++ b/src/Filters/Rules/Repository/_HasRepo.py @@ -32,7 +32,7 @@ from gettext import gettext as _ # GRAMPS modules # #------------------------------------------------------------------------- -from RelLib import RepositoryType +from gen.lib import RepositoryType from Filters.Rules._Rule import Rule #------------------------------------------------------------------------- diff --git a/src/Filters/Rules/_HasAttributeBase.py b/src/Filters/Rules/_HasAttributeBase.py index 2b40fcab1..c2a1feafe 100644 --- a/src/Filters/Rules/_HasAttributeBase.py +++ b/src/Filters/Rules/_HasAttributeBase.py @@ -32,7 +32,7 @@ from gettext import gettext as _ # GRAMPS modules # #------------------------------------------------------------------------- -from RelLib import AttributeType +from gen.lib import AttributeType from Filters.Rules._Rule import Rule #------------------------------------------------------------------------- diff --git a/src/Filters/Rules/_HasEventBase.py b/src/Filters/Rules/_HasEventBase.py index 87754cd44..5833c9318 100644 --- a/src/Filters/Rules/_HasEventBase.py +++ b/src/Filters/Rules/_HasEventBase.py @@ -33,7 +33,7 @@ from gettext import gettext as _ # #------------------------------------------------------------------------- import DateHandler -from RelLib import EventType +from gen.lib import EventType from Filters.Rules._Rule import Rule #------------------------------------------------------------------------- diff --git a/src/Filters/Rules/_HasMarkerBase.py b/src/Filters/Rules/_HasMarkerBase.py index d5d209d4c..09c79905d 100644 --- a/src/Filters/Rules/_HasMarkerBase.py +++ b/src/Filters/Rules/_HasMarkerBase.py @@ -32,7 +32,7 @@ from gettext import gettext as _ # GRAMPS modules # #------------------------------------------------------------------------- -from RelLib import MarkerType +from gen.lib import MarkerType from Filters.Rules._Rule import Rule #------------------------------------------------------------------------- diff --git a/src/Filters/SideBar/_EventSidebarFilter.py b/src/Filters/SideBar/_EventSidebarFilter.py index c612818d3..ce0f3a68a 100644 --- a/src/Filters/SideBar/_EventSidebarFilter.py +++ b/src/Filters/SideBar/_EventSidebarFilter.py @@ -40,7 +40,7 @@ import gtk # #------------------------------------------------------------------------- import GrampsWidgets -import RelLib +import gen.lib from _SidebarFilter import SidebarFilter from Filters import GenericFilterFactory, build_filter_model, Rules @@ -61,8 +61,8 @@ class EventSidebarFilter(SidebarFilter): def create_widget(self): self.filter_id = gtk.Entry() self.filter_desc = gtk.Entry() - self.filter_event = RelLib.Event() - self.filter_event.set_type((RelLib.EventType.CUSTOM,u'')) + self.filter_event = gen.lib.Event() + self.filter_event.set_type((gen.lib.EventType.CUSTOM,u'')) self.etype = gtk.ComboBoxEntry() self.event_menu = GrampsWidgets.MonitoredDataType( diff --git a/src/Filters/SideBar/_FamilySidebarFilter.py b/src/Filters/SideBar/_FamilySidebarFilter.py index 3e6266eaf..1136b0dde 100644 --- a/src/Filters/SideBar/_FamilySidebarFilter.py +++ b/src/Filters/SideBar/_FamilySidebarFilter.py @@ -40,7 +40,7 @@ import gtk # #------------------------------------------------------------------------- import GrampsWidgets -import RelLib +import gen.lib from _SidebarFilter import SidebarFilter from Filters import GenericFilterFactory, build_filter_model, Rules @@ -64,12 +64,12 @@ class FamilySidebarFilter(SidebarFilter): self.filter_mother = gtk.Entry() self.filter_child = gtk.Entry() - self.filter_event = RelLib.Event() - self.filter_event.set_type((RelLib.EventType.CUSTOM,u'')) + self.filter_event = gen.lib.Event() + self.filter_event.set_type((gen.lib.EventType.CUSTOM,u'')) self.etype = gtk.ComboBoxEntry() - self.family_stub = RelLib.Family() - self.family_stub.set_relationship((RelLib.FamilyRelType.CUSTOM,u'')) + self.family_stub = gen.lib.Family() + self.family_stub.set_relationship((gen.lib.FamilyRelType.CUSTOM,u'')) self.rtype = gtk.ComboBoxEntry() self.event_menu = GrampsWidgets.MonitoredDataType( @@ -82,8 +82,8 @@ class FamilySidebarFilter(SidebarFilter): self.family_stub.set_relationship, self.family_stub.get_relationship) - self.filter_marker = RelLib.Family() - self.filter_marker.set_marker((RelLib.MarkerType.CUSTOM,u'')) + self.filter_marker = gen.lib.Family() + self.filter_marker.set_marker((gen.lib.MarkerType.CUSTOM,u'')) self.mtype = gtk.ComboBoxEntry() self.marker_menu = GrampsWidgets.MonitoredDataType( self.mtype, diff --git a/src/Filters/SideBar/_MediaSidebarFilter.py b/src/Filters/SideBar/_MediaSidebarFilter.py index 7e7bf6150..9ec441d9f 100644 --- a/src/Filters/SideBar/_MediaSidebarFilter.py +++ b/src/Filters/SideBar/_MediaSidebarFilter.py @@ -40,7 +40,7 @@ import gtk # #------------------------------------------------------------------------- import GrampsWidgets -import RelLib +import gen.lib from _SidebarFilter import SidebarFilter from Filters import GenericFilterFactory, build_filter_model, Rules diff --git a/src/Filters/SideBar/_NoteSidebarFilter.py b/src/Filters/SideBar/_NoteSidebarFilter.py index 5a76e6c2e..c615223c9 100644 --- a/src/Filters/SideBar/_NoteSidebarFilter.py +++ b/src/Filters/SideBar/_NoteSidebarFilter.py @@ -40,7 +40,7 @@ import gtk # #------------------------------------------------------------------------- import GrampsWidgets -from RelLib import Note, NoteType +from gen.lib import Note, NoteType from _SidebarFilter import SidebarFilter from Filters import GenericFilterFactory, build_filter_model, Rules diff --git a/src/Filters/SideBar/_PersonSidebarFilter.py b/src/Filters/SideBar/_PersonSidebarFilter.py index 0fe88fed5..5d67778f9 100644 --- a/src/Filters/SideBar/_PersonSidebarFilter.py +++ b/src/Filters/SideBar/_PersonSidebarFilter.py @@ -40,7 +40,7 @@ import gtk # #------------------------------------------------------------------------- import GrampsWidgets -import RelLib +import gen.lib import DateHandler from _SidebarFilter import SidebarFilter @@ -72,16 +72,16 @@ class PersonSidebarFilter(SidebarFilter): self.filter_id = gtk.Entry() self.filter_birth = gtk.Entry() self.filter_death = gtk.Entry() - self.filter_event = RelLib.Event() - self.filter_event.set_type((RelLib.EventType.CUSTOM, u'')) + self.filter_event = gen.lib.Event() + self.filter_event.set_type((gen.lib.EventType.CUSTOM, u'')) self.etype = gtk.ComboBoxEntry() self.event_menu = GrampsWidgets.MonitoredDataType( self.etype, self.filter_event.set_type, self.filter_event.get_type) - self.filter_marker = RelLib.Person() - self.filter_marker.set_marker((RelLib.MarkerType.CUSTOM, u'')) + self.filter_marker = gen.lib.Person() + self.filter_marker.set_marker((gen.lib.MarkerType.CUSTOM, u'')) self.mtype = gtk.ComboBoxEntry() self.marker_menu = GrampsWidgets.MonitoredDataType( self.mtype, @@ -102,13 +102,13 @@ class PersonSidebarFilter(SidebarFilter): self.generic.add_attribute(cell, 'text', 0) self.on_filters_changed('Person') - exdate1 = RelLib.Date() - exdate2 = RelLib.Date() - exdate1.set(RelLib.Date.QUAL_NONE, RelLib.Date.MOD_RANGE, - RelLib.Date.CAL_GREGORIAN, (0, 0, 1800, False, + exdate1 = gen.lib.Date() + exdate2 = gen.lib.Date() + exdate1.set(gen.lib.Date.QUAL_NONE, gen.lib.Date.MOD_RANGE, + gen.lib.Date.CAL_GREGORIAN, (0, 0, 1800, False, 0, 0, 1900, False)) - exdate2.set(RelLib.Date.QUAL_NONE, RelLib.Date.MOD_BEFORE, - RelLib.Date.CAL_GREGORIAN, (0, 0, 1850, False)) + exdate2.set(gen.lib.Date.QUAL_NONE, gen.lib.Date.MOD_BEFORE, + gen.lib.Date.CAL_GREGORIAN, (0, 0, 1850, False)) msg1 = DateHandler.displayer.display(exdate1) msg2 = DateHandler.displayer.display(exdate2) diff --git a/src/Filters/SideBar/_PlaceSidebarFilter.py b/src/Filters/SideBar/_PlaceSidebarFilter.py index 3381da088..d4a6ced2d 100644 --- a/src/Filters/SideBar/_PlaceSidebarFilter.py +++ b/src/Filters/SideBar/_PlaceSidebarFilter.py @@ -40,7 +40,7 @@ import gtk # #------------------------------------------------------------------------- import GrampsWidgets -import RelLib +import gen.lib from _SidebarFilter import SidebarFilter from Filters import GenericFilterFactory, build_filter_model, Rules diff --git a/src/Filters/SideBar/_RepoSidebarFilter.py b/src/Filters/SideBar/_RepoSidebarFilter.py index ceac288fe..e750e98ae 100644 --- a/src/Filters/SideBar/_RepoSidebarFilter.py +++ b/src/Filters/SideBar/_RepoSidebarFilter.py @@ -40,7 +40,7 @@ import gtk # #------------------------------------------------------------------------- import GrampsWidgets -from RelLib import Repository, RepositoryType +from gen.lib import Repository, RepositoryType from _SidebarFilter import SidebarFilter from Filters import GenericFilterFactory, build_filter_model, Rules diff --git a/src/Filters/SideBar/_SourceSidebarFilter.py b/src/Filters/SideBar/_SourceSidebarFilter.py index 7af589c96..2ea044a25 100644 --- a/src/Filters/SideBar/_SourceSidebarFilter.py +++ b/src/Filters/SideBar/_SourceSidebarFilter.py @@ -40,7 +40,7 @@ import gtk # #------------------------------------------------------------------------- import GrampsWidgets -import RelLib +import gen.lib from _SidebarFilter import SidebarFilter from Filters import GenericFilterFactory, build_filter_model, Rules diff --git a/src/Filters/_GenericFilter.py b/src/Filters/_GenericFilter.py index 162fe3b05..59ba11884 100644 --- a/src/Filters/_GenericFilter.py +++ b/src/Filters/_GenericFilter.py @@ -24,7 +24,7 @@ Package providing filtering framework for GRAMPS. """ -import RelLib +import gen.lib #------------------------------------------------------------------------- # # GenericFilter @@ -100,7 +100,7 @@ class GenericFilter: return db.get_person_cursor() def make_obj(self): - return RelLib.Person() + return gen.lib.Person() def find_from_handle(self, db, handle): return db.get_person_from_handle(handle) @@ -213,7 +213,7 @@ class GenericFamilyFilter(GenericFilter): return db.get_family_cursor() def make_obj(self): - return RelLib.Family() + return gen.lib.Family() def find_from_handle(self, db, handle): return db.get_family_from_handle(handle) @@ -227,7 +227,7 @@ class GenericEventFilter(GenericFilter): return db.get_event_cursor() def make_obj(self): - return RelLib.Event() + return gen.lib.Event() def find_from_handle(self, db, handle): return db.get_event_from_handle(handle) @@ -241,7 +241,7 @@ class GenericSourceFilter(GenericFilter): return db.get_source_cursor() def make_obj(self): - return RelLib.Source() + return gen.lib.Source() def find_from_handle(self, db, handle): return db.get_source_from_handle(handle) @@ -255,7 +255,7 @@ class GenericPlaceFilter(GenericFilter): return db.get_place_cursor() def make_obj(self): - return RelLib.Place() + return gen.lib.Place() def find_from_handle(self, db, handle): return db.get_place_from_handle(handle) @@ -269,7 +269,7 @@ class GenericMediaFilter(GenericFilter): return db.get_media_cursor() def make_obj(self): - return RelLib.MediaObject() + return gen.lib.MediaObject() def find_from_handle(self, db, handle): return db.get_object_from_handle(handle) @@ -283,7 +283,7 @@ class GenericRepoFilter(GenericFilter): return db.get_repository_cursor() def make_obj(self): - return RelLib.Repository() + return gen.lib.Repository() def find_from_handle(self, db, handle): return db.get_repository_from_handle(handle) @@ -297,7 +297,7 @@ class GenericNoteFilter(GenericFilter): return db.get_note_cursor() def make_obj(self): - return RelLib.Note() + return gen.lib.Note() def find_from_handle(self, db, handle): return db.get_note_from_handle(handle) diff --git a/src/GrampsCfg.py b/src/GrampsCfg.py index bd179e1bb..6f102a422 100644 --- a/src/GrampsCfg.py +++ b/src/GrampsCfg.py @@ -43,7 +43,7 @@ import gtk import Config import DateHandler from BasicUtils import name_displayer as _nd -from RelLib import Name +from gen.lib import Name import ManagedWindow from GrampsWidgets import * import QuestionDialog @@ -73,7 +73,7 @@ def set_calendar_date_format(): DateHandler.set_format(Config.get_date_format(format_list)) def get_researcher(): - import RelLib + import gen.lib n = Config.get(Config.RESEARCHER_NAME) a = Config.get(Config.RESEARCHER_ADDR) @@ -84,7 +84,7 @@ def get_researcher(): ph = Config.get(Config.RESEARCHER_PHONE) e = Config.get(Config.RESEARCHER_EMAIL) - owner = RelLib.Researcher() + owner = gen.lib.Researcher() owner.set(n, a, c, s, ct, p, ph, e) return owner diff --git a/src/GrampsDb/_GrampsBSDDB.py b/src/GrampsDb/_GrampsBSDDB.py index b3748562b..9cd4b5b1b 100644 --- a/src/GrampsDb/_GrampsBSDDB.py +++ b/src/GrampsDb/_GrampsBSDDB.py @@ -44,7 +44,7 @@ __LOG = logging.getLogger(".GrampsDb") # Gramps modules # #------------------------------------------------------------------------- -from RelLib import * +from gen.lib import * from gen.db.base import * from gen.utils import db_copy import gen.db.const as const diff --git a/src/GrampsDb/_GrampsDbWriteXML.py b/src/GrampsDb/_GrampsDbWriteXML.py index ac818ce90..ad9406376 100644 --- a/src/GrampsDb/_GrampsDbWriteXML.py +++ b/src/GrampsDb/_GrampsDbWriteXML.py @@ -51,7 +51,7 @@ log = logging.getLogger(".WriteXML") # #------------------------------------------------------------------------- -import RelLib +import gen.lib from BasicUtils import UpdateCallback from gen.db.dbconst import \ @@ -443,9 +443,9 @@ class GrampsDbXmlWriter(UpdateCallback): def write_person(self,person,index=1): sp = " "*index self.write_primary_tag("person",person,index) - if person.get_gender() == RelLib.Person.MALE: + if person.get_gender() == gen.lib.Person.MALE: self.write_line("gender","M",index+1) - elif person.get_gender() == RelLib.Person.FEMALE: + elif person.get_gender() == gen.lib.Person.FEMALE: self.write_line("gender","F",index+1) else: self.write_line("gender","U",index+1) @@ -774,15 +774,15 @@ class GrampsDbXmlWriter(UpdateCallback): sp = ' '*indent cal= date.get_calendar() - if cal != RelLib.Date.CAL_GREGORIAN: - calstr = ' cformat="%s"' % RelLib.Date.calendar_names[cal] + if cal != gen.lib.Date.CAL_GREGORIAN: + calstr = ' cformat="%s"' % gen.lib.Date.calendar_names[cal] else: calstr = '' qual = date.get_quality() - if qual == RelLib.Date.QUAL_ESTIMATED: + if qual == gen.lib.Date.QUAL_ESTIMATED: qual_str = ' quality="estimated"' - elif qual == RelLib.Date.QUAL_CALCULATED: + elif qual == gen.lib.Date.QUAL_CALCULATED: qual_str = ' quality="calculated"' else: qual_str = "" @@ -790,7 +790,7 @@ class GrampsDbXmlWriter(UpdateCallback): mode = date.get_modifier() if date.is_compound(): - if mode == RelLib.Date.MOD_RANGE: + if mode == gen.lib.Date.MOD_RANGE: tagname = 'daterange' else: tagname = 'datespan' @@ -800,16 +800,16 @@ class GrampsDbXmlWriter(UpdateCallback): if d1 != "" or d2 != "": self.g.write('%s<%s start="%s" stop="%s"%s%s/>\n' % (sp,tagname,d1,d2,qual_str,calstr)) - elif mode != RelLib.Date.MOD_TEXTONLY: + elif mode != gen.lib.Date.MOD_TEXTONLY: date_str = self.get_iso_date(date.get_start_date()) if date_str == "": return - if mode == RelLib.Date.MOD_BEFORE: + if mode == gen.lib.Date.MOD_BEFORE: mode_str = ' type="before"' - elif mode == RelLib.Date.MOD_AFTER: + elif mode == gen.lib.Date.MOD_AFTER: mode_str = ' type="after"' - elif mode == RelLib.Date.MOD_ABOUT: + elif mode == gen.lib.Date.MOD_ABOUT: mode_str = ' type="about"' else: mode_str = "" diff --git a/src/GrampsDb/_GrampsGEDDB.py b/src/GrampsDb/_GrampsGEDDB.py index c76497be9..e91a7835c 100644 --- a/src/GrampsDb/_GrampsGEDDB.py +++ b/src/GrampsDb/_GrampsGEDDB.py @@ -25,7 +25,7 @@ Provides the GRAMPS DB interface for supporting in-memory editing of GEDCOM files. """ -from RelLib import * +from gen.lib import * from _GrampsInMemDB import * from _GrampsDbExceptions import GrampsDbException diff --git a/src/GrampsDb/_GrampsInMemDB.py b/src/GrampsDb/_GrampsInMemDB.py index 63a7fbd79..a6ed0769b 100644 --- a/src/GrampsDb/_GrampsInMemDB.py +++ b/src/GrampsDb/_GrampsInMemDB.py @@ -37,7 +37,7 @@ import time # GRAMPS modules # #------------------------------------------------------------------------- -from RelLib import * +from gen.lib import * from _GrampsDbBase import * from _GrampsCursor import GrampsCursor diff --git a/src/GrampsDb/_GrampsXMLDB.py b/src/GrampsDb/_GrampsXMLDB.py index 8130009f9..b36218cfa 100644 --- a/src/GrampsDb/_GrampsXMLDB.py +++ b/src/GrampsDb/_GrampsXMLDB.py @@ -28,7 +28,7 @@ of GRAMPS XML format. import logging log = logging.getLogger(".GrampsDb") -from RelLib import * +from gen.lib import * from _GrampsInMemDB import * from _GrampsDbExceptions import GrampsDbException diff --git a/src/GrampsDbUtils/_GedcomInfo.py b/src/GrampsDbUtils/_GedcomInfo.py index 72a682ee5..8be1036dc 100644 --- a/src/GrampsDbUtils/_GedcomInfo.py +++ b/src/GrampsDbUtils/_GedcomInfo.py @@ -32,7 +32,7 @@ import os # #------------------------------------------------------------------------- import const -import RelLib +import gen.lib ADOPT_NONE = 0 ADOPT_EVENT = 1 @@ -65,67 +65,67 @@ SOURCE_REFS_YES = 1 # #------------------------------------------------------------------------- familyConstantEvents = { - RelLib.EventType.ANNULMENT : "ANUL", - RelLib.EventType.DIV_FILING : "DIVF", - RelLib.EventType.DIVORCE : "DIV", - RelLib.EventType.CENSUS : "CENS", - RelLib.EventType.ENGAGEMENT : "ENGA", - RelLib.EventType.MARR_BANNS : "MARB", - RelLib.EventType.MARR_CONTR : "MARC", - RelLib.EventType.MARR_LIC : "MARL", - RelLib.EventType.MARR_SETTL : "MARS", - RelLib.EventType.MARRIAGE : "MARR" + gen.lib.EventType.ANNULMENT : "ANUL", + gen.lib.EventType.DIV_FILING : "DIVF", + gen.lib.EventType.DIVORCE : "DIV", + gen.lib.EventType.CENSUS : "CENS", + gen.lib.EventType.ENGAGEMENT : "ENGA", + gen.lib.EventType.MARR_BANNS : "MARB", + gen.lib.EventType.MARR_CONTR : "MARC", + gen.lib.EventType.MARR_LIC : "MARL", + gen.lib.EventType.MARR_SETTL : "MARS", + gen.lib.EventType.MARRIAGE : "MARR" } personalConstantEvents = { - RelLib.EventType.ADOPT : "ADOP", - RelLib.EventType.ADULT_CHRISTEN : "CHRA", - RelLib.EventType.BIRTH : "BIRT", - RelLib.EventType.DEATH : "DEAT", - RelLib.EventType.BAPTISM : "BAPM", - RelLib.EventType.BAR_MITZVAH : "BARM", - RelLib.EventType.BAS_MITZVAH : "BASM", - RelLib.EventType.BLESS : "BLES", - RelLib.EventType.BURIAL : "BURI", - RelLib.EventType.CAUSE_DEATH : "CAUS", - RelLib.EventType.ORDINATION : "ORDN", - RelLib.EventType.CENSUS : "CENS", - RelLib.EventType.CHRISTEN : "CHR" , - RelLib.EventType.CONFIRMATION : "CONF", - RelLib.EventType.CREMATION : "CREM", - RelLib.EventType.DEGREE : "_DEG", - RelLib.EventType.DIV_FILING : "DIVF", - RelLib.EventType.EDUCATION : "EDUC", - RelLib.EventType.ELECTED : "", - RelLib.EventType.EMIGRATION : "EMIG", - RelLib.EventType.FIRST_COMMUN : "FCOM", - RelLib.EventType.GRADUATION : "GRAD", - RelLib.EventType.MED_INFO : "_MDCL", - RelLib.EventType.MILITARY_SERV : "_MILT", - RelLib.EventType.NATURALIZATION : "NATU", - RelLib.EventType.NOB_TITLE : "TITL", - RelLib.EventType.NUM_MARRIAGES : "NMR", - RelLib.EventType.IMMIGRATION : "IMMI", - RelLib.EventType.OCCUPATION : "OCCU", - RelLib.EventType.PROBATE : "PROB", - RelLib.EventType.PROPERTY : "PROP", - RelLib.EventType.RELIGION : "RELI", - RelLib.EventType.RESIDENCE : "RESI", - RelLib.EventType.RETIREMENT : "RETI", - RelLib.EventType.WILL : "WILL", + gen.lib.EventType.ADOPT : "ADOP", + gen.lib.EventType.ADULT_CHRISTEN : "CHRA", + gen.lib.EventType.BIRTH : "BIRT", + gen.lib.EventType.DEATH : "DEAT", + gen.lib.EventType.BAPTISM : "BAPM", + gen.lib.EventType.BAR_MITZVAH : "BARM", + gen.lib.EventType.BAS_MITZVAH : "BASM", + gen.lib.EventType.BLESS : "BLES", + gen.lib.EventType.BURIAL : "BURI", + gen.lib.EventType.CAUSE_DEATH : "CAUS", + gen.lib.EventType.ORDINATION : "ORDN", + gen.lib.EventType.CENSUS : "CENS", + gen.lib.EventType.CHRISTEN : "CHR" , + gen.lib.EventType.CONFIRMATION : "CONF", + gen.lib.EventType.CREMATION : "CREM", + gen.lib.EventType.DEGREE : "_DEG", + gen.lib.EventType.DIV_FILING : "DIVF", + gen.lib.EventType.EDUCATION : "EDUC", + gen.lib.EventType.ELECTED : "", + gen.lib.EventType.EMIGRATION : "EMIG", + gen.lib.EventType.FIRST_COMMUN : "FCOM", + gen.lib.EventType.GRADUATION : "GRAD", + gen.lib.EventType.MED_INFO : "_MDCL", + gen.lib.EventType.MILITARY_SERV : "_MILT", + gen.lib.EventType.NATURALIZATION : "NATU", + gen.lib.EventType.NOB_TITLE : "TITL", + gen.lib.EventType.NUM_MARRIAGES : "NMR", + gen.lib.EventType.IMMIGRATION : "IMMI", + gen.lib.EventType.OCCUPATION : "OCCU", + gen.lib.EventType.PROBATE : "PROB", + gen.lib.EventType.PROPERTY : "PROP", + gen.lib.EventType.RELIGION : "RELI", + gen.lib.EventType.RESIDENCE : "RESI", + gen.lib.EventType.RETIREMENT : "RETI", + gen.lib.EventType.WILL : "WILL", } familyConstantAttributes = { - RelLib.AttributeType.NUM_CHILD : "NCHI", + gen.lib.AttributeType.NUM_CHILD : "NCHI", } personalConstantAttributes = { - RelLib.AttributeType.CASTE : "CAST", - RelLib.AttributeType.DESCRIPTION : "DSCR", - RelLib.AttributeType.ID : "IDNO", - RelLib.AttributeType.NATIONAL : "NATI", - RelLib.AttributeType.NUM_CHILD : "NCHI", - RelLib.AttributeType.SSN : "SSN", + gen.lib.AttributeType.CASTE : "CAST", + gen.lib.AttributeType.DESCRIPTION : "DSCR", + gen.lib.AttributeType.ID : "IDNO", + gen.lib.AttributeType.NATIONAL : "NATI", + gen.lib.AttributeType.NUM_CHILD : "NCHI", + gen.lib.AttributeType.SSN : "SSN", } #------------------------------------------------------------------------- @@ -134,19 +134,19 @@ personalConstantAttributes = { # #------------------------------------------------------------------------- lds_status = { - "BIC" : RelLib.LdsOrd.STATUS_BIC, - "CANCELED" : RelLib.LdsOrd.STATUS_CANCELED, - "CHILD" : RelLib.LdsOrd.STATUS_CHILD, - "CLEARED" : RelLib.LdsOrd.STATUS_CLEARED, - "COMPLETED": RelLib.LdsOrd.STATUS_COMPLETED, - "DNS" : RelLib.LdsOrd.STATUS_DNS, - "INFANT" : RelLib.LdsOrd.STATUS_INFANT, - "PRE-1970" : RelLib.LdsOrd.STATUS_PRE_1970, - "QUALIFIED": RelLib.LdsOrd.STATUS_QUALIFIED, - "DNS/CAN" : RelLib.LdsOrd.STATUS_DNS_CAN, - "STILLBORN": RelLib.LdsOrd.STATUS_STILLBORN, - "SUBMITTED": RelLib.LdsOrd.STATUS_SUBMITTED, - "UNCLEARED": RelLib.LdsOrd.STATUS_UNCLEARED, + "BIC" : gen.lib.LdsOrd.STATUS_BIC, + "CANCELED" : gen.lib.LdsOrd.STATUS_CANCELED, + "CHILD" : gen.lib.LdsOrd.STATUS_CHILD, + "CLEARED" : gen.lib.LdsOrd.STATUS_CLEARED, + "COMPLETED": gen.lib.LdsOrd.STATUS_COMPLETED, + "DNS" : gen.lib.LdsOrd.STATUS_DNS, + "INFANT" : gen.lib.LdsOrd.STATUS_INFANT, + "PRE-1970" : gen.lib.LdsOrd.STATUS_PRE_1970, + "QUALIFIED": gen.lib.LdsOrd.STATUS_QUALIFIED, + "DNS/CAN" : gen.lib.LdsOrd.STATUS_DNS_CAN, + "STILLBORN": gen.lib.LdsOrd.STATUS_STILLBORN, + "SUBMITTED": gen.lib.LdsOrd.STATUS_SUBMITTED, + "UNCLEARED": gen.lib.LdsOrd.STATUS_UNCLEARED, } #------------------------------------------------------------------------- diff --git a/src/GrampsDbUtils/_GedcomLex.py b/src/GrampsDbUtils/_GedcomLex.py index 2c4fdc3c3..77d7de844 100644 --- a/src/GrampsDbUtils/_GedcomLex.py +++ b/src/GrampsDbUtils/_GedcomLex.py @@ -39,7 +39,7 @@ import re from _GedcomInfo import * import _GedcomTokens as GedcomTokens -import RelLib +import gen.lib from DateHandler._DateParser import DateParser #------------------------------------------------------------------------ @@ -84,20 +84,20 @@ RANGE = re.compile(r"\s*BET\s+@#D?([^@]+)@\s*(.*)\s+AND\s+@#D?([^@]+)@\s*(.*)$") SPAN = re.compile(r"\s*FROM\s+@#D?([^@]+)@\s*(.*)\s+TO\s+@#D?([^@]+)@\s*(.*)$") CALENDAR_MAP = { - "FRENCH R" : RelLib.Date.CAL_FRENCH, - "JULIAN" : RelLib.Date.CAL_JULIAN, - "HEBREW" : RelLib.Date.CAL_HEBREW, + "FRENCH R" : gen.lib.Date.CAL_FRENCH, + "JULIAN" : gen.lib.Date.CAL_JULIAN, + "HEBREW" : gen.lib.Date.CAL_HEBREW, } QUALITY_MAP = { - 'CAL' : RelLib.Date.QUAL_CALCULATED, - 'INT' : RelLib.Date.QUAL_CALCULATED, - 'EST' : RelLib.Date.QUAL_ESTIMATED, + 'CAL' : gen.lib.Date.QUAL_CALCULATED, + 'INT' : gen.lib.Date.QUAL_CALCULATED, + 'EST' : gen.lib.Date.QUAL_ESTIMATED, } SEX_MAP = { - 'F' : RelLib.Person.FEMALE, - 'M' : RelLib.Person.MALE, + 'F' : gen.lib.Person.FEMALE, + 'M' : gen.lib.Person.MALE, } #----------------------------------------------------------------------- @@ -133,8 +133,8 @@ class GedLine: this is just a text string. However, for certain tokens where we know the context, we can provide some value. The current parsed tokens are: - TOKEN_DATE - RelLib.Date - TOKEN_SEX - RelLib.Person gender item + TOKEN_DATE - gen.lib.Date + TOKEN_SEX - gen.lib.Person gender item TOEKN_UKNOWN - Check to see if this is a known event """ @@ -167,16 +167,16 @@ class GedLine: def calc_sex(self): """ - Converts the data field to a RelLib token indicating the gender + Converts the data field to a gen.lib token indicating the gender """ try: - self.data = SEX_MAP.get(self.data.strip()[0], RelLib.Person.UNKNOWN) + self.data = SEX_MAP.get(self.data.strip()[0], gen.lib.Person.UNKNOWN) except: - self.data = RelLib.Person.UNKNOWN + self.data = gen.lib.Person.UNKNOWN def calc_date(self): """ - Converts the data field to a RelLib.Date object + Converts the data field to a gen.lib.Date object """ self.data = extract_date(self.data) @@ -188,7 +188,7 @@ class GedLine: """ token = GED2GRAMPS.get(self.token_text) if token: - event = RelLib.Event() + event = gen.lib.Event() event.set_description(self.data) event.set_type(token) self.token = GedcomTokens.TOKEN_GEVENT @@ -196,7 +196,7 @@ class GedLine: else: token = GED2ATTR.get(self.token_text) if token: - attr = RelLib.Attribute() + attr = gen.lib.Attribute() attr.set_value(self.data) attr.set_type(token) self.token = GedcomTokens.TOKEN_ATTR @@ -209,16 +209,16 @@ class GedLine: self.data = gid[1:-1] def calc_nchi(self): - attr = RelLib.Attribute() + attr = gen.lib.Attribute() attr.set_value(self.data) - attr.set_type(RelLib.AttributeType.NUM_CHILD) + attr.set_type(gen.lib.AttributeType.NUM_CHILD) self.data = attr self.token = GedcomTokens.TOKEN_ATTR def calc_attr(self): - attr = RelLib.Attribute() + attr = gen.lib.Attribute() attr.set_value(self.data) - attr.set_type((RelLib.AttributeType.CUSTOM, self.token_text)) + attr.set_type((gen.lib.AttributeType.CUSTOM, self.token_text)) self.data = attr self.token = GedcomTokens.TOKEN_ATTR @@ -253,9 +253,9 @@ DATE_CNV = GedcomDateParser() def extract_date(text): """ - Converts the specified text to a RelLib.Date object. + Converts the specified text to a gen.lib.Date object. """ - dateobj = RelLib.Date() + dateobj = gen.lib.Date() text = text.replace('BET ABT','EST BET') # Horrible hack for Tim Lyons @@ -264,20 +264,20 @@ def extract_date(text): match = MOD.match(text) if match: (mod, text) = match.groups() - qual = QUALITY_MAP.get(mod, RelLib.Date.QUAL_NONE) + qual = QUALITY_MAP.get(mod, gen.lib.Date.QUAL_NONE) else: - qual = RelLib.Date.QUAL_NONE + qual = gen.lib.Date.QUAL_NONE # parse the range if we match, if so, return match = RANGE.match(text) if match: (cal1, data1, ignore, cal2, data2) = match.groups() - cal = CALENDAR_MAP.get(cal1, RelLib.Date.CAL_GREGORIAN) + cal = CALENDAR_MAP.get(cal1, gen.lib.Date.CAL_GREGORIAN) start = DATE_CNV.parse(data1) stop = DATE_CNV.parse(data2) - dateobj.set(RelLib.Date.QUAL_NONE, RelLib.Date.MOD_RANGE, cal, + dateobj.set(gen.lib.Date.QUAL_NONE, gen.lib.Date.MOD_RANGE, cal, start.get_start_date() + stop.get_start_date()) dateobj.set_quality(qual) return dateobj @@ -287,11 +287,11 @@ def extract_date(text): if match: (cal1, data1, cal2, data2) = match.groups() - cal = CALENDAR_MAP.get(cal1, RelLib.Date.CAL_GREGORIAN) + cal = CALENDAR_MAP.get(cal1, gen.lib.Date.CAL_GREGORIAN) start = DATE_CNV.parse(data1) stop = DATE_CNV.parse(data2) - dateobj.set(RelLib.Date.QUAL_NONE, RelLib.Date.MOD_SPAN, cal, + dateobj.set(gen.lib.Date.QUAL_NONE, gen.lib.Date.MOD_SPAN, cal, start.get_start_date() + stop.get_start_date()) dateobj.set_quality(qual) return dateobj @@ -304,7 +304,7 @@ def extract_date(text): else: dateobj = DATE_CNV.parse(data) dateobj.set_calendar(CALENDAR_MAP.get(cal, - RelLib.Date.CAL_GREGORIAN)) + gen.lib.Date.CAL_GREGORIAN)) dateobj.set_quality(qual) return dateobj diff --git a/src/GrampsDbUtils/_GedcomParse.py b/src/GrampsDbUtils/_GedcomParse.py index d30f3f5c9..9792d3295 100644 --- a/src/GrampsDbUtils/_GedcomParse.py +++ b/src/GrampsDbUtils/_GedcomParse.py @@ -109,7 +109,7 @@ LOG = logging.getLogger(".GedcomImport") # #------------------------------------------------------------------------- import Errors -import RelLib +import gen.lib from BasicUtils import name_displayer, UpdateCallback import Mime import LdsUtils @@ -141,19 +141,19 @@ TRUNC_MSG = _("Your GEDCOM file is corrupted. " # constants # #------------------------------------------------------------------------- -TYPE_BIRTH = RelLib.ChildRefType() -TYPE_ADOPT = RelLib.ChildRefType(RelLib.ChildRefType.ADOPTED) -TYPE_FOSTER = RelLib.ChildRefType(RelLib.ChildRefType.FOSTER) +TYPE_BIRTH = gen.lib.ChildRefType() +TYPE_ADOPT = gen.lib.ChildRefType(gen.lib.ChildRefType.ADOPTED) +TYPE_FOSTER = gen.lib.ChildRefType(gen.lib.ChildRefType.FOSTER) RELATION_TYPES = ( - RelLib.ChildRefType.BIRTH, - RelLib.ChildRefType.UNKNOWN, - RelLib.ChildRefType.NONE, + gen.lib.ChildRefType.BIRTH, + gen.lib.ChildRefType.UNKNOWN, + gen.lib.ChildRefType.NONE, ) PEDIGREE_TYPES = { - 'birth' : RelLib.ChildRefType(), - 'natural': RelLib.ChildRefType(), + 'birth' : gen.lib.ChildRefType(), + 'natural': gen.lib.ChildRefType(), 'step' : TYPE_ADOPT, 'adopted': TYPE_ADOPT, 'foster' : TYPE_FOSTER, @@ -174,28 +174,28 @@ EVENT_FAMILY_STR = _("%(event_name)s of %(family)s") EVENT_PERSON_STR = _("%(event_name)s of %(person)s") FTW_BAD_PLACE = [ - RelLib.EventType.OCCUPATION, - RelLib.EventType.RELIGION, - RelLib.EventType.DEGREE + gen.lib.EventType.OCCUPATION, + gen.lib.EventType.RELIGION, + gen.lib.EventType.DEGREE ] MEDIA_MAP = { - 'audio' : RelLib.SourceMediaType.AUDIO, - 'book' : RelLib.SourceMediaType.BOOK, - 'card' : RelLib.SourceMediaType.CARD, - 'electronic' : RelLib.SourceMediaType.ELECTRONIC, - 'fiche' : RelLib.SourceMediaType.FICHE, - 'microfiche' : RelLib.SourceMediaType.FICHE, - 'microfilm' : RelLib.SourceMediaType.FICHE, - 'film' : RelLib.SourceMediaType.FILM, - 'magazine' : RelLib.SourceMediaType.MAGAZINE, - 'manuscript' : RelLib.SourceMediaType.MANUSCRIPT, - 'map' : RelLib.SourceMediaType.MAP, - 'newspaper' : RelLib.SourceMediaType.NEWSPAPER, - 'photo' : RelLib.SourceMediaType.PHOTO, - 'tombstone' : RelLib.SourceMediaType.TOMBSTONE, - 'grave' : RelLib.SourceMediaType.TOMBSTONE, - 'video' : RelLib.SourceMediaType.VIDEO, + 'audio' : gen.lib.SourceMediaType.AUDIO, + 'book' : gen.lib.SourceMediaType.BOOK, + 'card' : gen.lib.SourceMediaType.CARD, + 'electronic' : gen.lib.SourceMediaType.ELECTRONIC, + 'fiche' : gen.lib.SourceMediaType.FICHE, + 'microfiche' : gen.lib.SourceMediaType.FICHE, + 'microfilm' : gen.lib.SourceMediaType.FICHE, + 'film' : gen.lib.SourceMediaType.FILM, + 'magazine' : gen.lib.SourceMediaType.MAGAZINE, + 'manuscript' : gen.lib.SourceMediaType.MANUSCRIPT, + 'map' : gen.lib.SourceMediaType.MAP, + 'newspaper' : gen.lib.SourceMediaType.NEWSPAPER, + 'photo' : gen.lib.SourceMediaType.PHOTO, + 'tombstone' : gen.lib.SourceMediaType.TOMBSTONE, + 'grave' : gen.lib.SourceMediaType.TOMBSTONE, + 'video' : gen.lib.SourceMediaType.VIDEO, } #------------------------------------------------------------------------- @@ -276,7 +276,7 @@ class GedcomParser(UpdateCallback): self.gedsource = self.gedmap.get_from_source_tag('GEDCOM 5.5') self.use_def_src = default_source if self.use_def_src: - self.def_src = RelLib.Source() + self.def_src = gen.lib.Source() fname = os.path.basename(filename).split('\\')[-1] self.def_src.set_title(_("Import from GEDCOM (%s)") % encode_filename(fname)) @@ -830,7 +830,7 @@ class GedcomParser(UpdateCallback): for title in self.inline_srcs.keys(): handle = self.inline_srcs[title] - src = RelLib.Source() + src = gen.lib.Source() src.set_handle(handle) src.set_title(title) self.dbase.add_source(src, self.trans) @@ -869,7 +869,7 @@ class GedcomParser(UpdateCallback): already used (is in the db), we return the item in the db. Otherwise, we create a new person, assign the handle and GRAMPS ID. """ - person = RelLib.Person() + person = gen.lib.Person() intid = self.gid2id.get(gramps_id) if self.dbase.has_person_handle(intid): person.unserialize(self.dbase.get_raw_person_data(intid)) @@ -885,7 +885,7 @@ class GedcomParser(UpdateCallback): already used (is in the db), we return the item in the db. Otherwise, we create a new family, assign the handle and GRAMPS ID. """ - family = RelLib.Family() + family = gen.lib.Family() intid = self.fid2id.get(gramps_id) if self.dbase.has_family_handle(intid): family.unserialize(self.dbase.get_raw_family_data(intid)) @@ -901,7 +901,7 @@ class GedcomParser(UpdateCallback): already used (is in the db), we return the item in the db. Otherwise, we create a new media object, assign the handle and GRAMPS ID. """ - obj = RelLib.MediaObject() + obj = gen.lib.MediaObject() intid = self.oid2id.get(gramps_id) if self.dbase.has_object_handle(intid): obj.unserialize(self.dbase.get_raw_object_data(intid)) @@ -917,7 +917,7 @@ class GedcomParser(UpdateCallback): already used (is in the db), we return the item in the db. Otherwise, we create a new source, assign the handle and GRAMPS ID. """ - obj = RelLib.Source() + obj = gen.lib.Source() intid = self.sid2id.get(gramps_id) if self.dbase.has_source_handle(intid): obj.unserialize(self.dbase.get_raw_source_data(intid)) @@ -936,7 +936,7 @@ class GedcomParser(UpdateCallback): Some GEDCOM "flavors" destroy the specification, and declare the repository inline instead of in a object. """ - repository = RelLib.Repository() + repository = gen.lib.Repository() if not gramps_id: need_commit = True gramps_id = self.dbase.find_next_repository_gramps_id() @@ -963,7 +963,7 @@ class GedcomParser(UpdateCallback): Some GEDCOM "flavors" destroy the specification, and declare the repository inline instead of in a object. """ - note = RelLib.Note() + note = gen.lib.Note() if not gramps_id: need_commit = True gramps_id = self.dbase.find_next_note_gramps_id() @@ -987,7 +987,7 @@ class GedcomParser(UpdateCallback): already used (is in the db), we return the item in the db. Otherwise, we create a new place, assign the handle and GRAMPS ID. """ - place = RelLib.Place() + place = gen.lib.Place() # check to see if we've encountered this name before # if we haven't we need to get a new GRAMPS ID @@ -1282,8 +1282,8 @@ class GedcomParser(UpdateCallback): @param state: The current state @type state: CurrentState """ - attr = RelLib.Attribute() - attr.set_type((RelLib.AttributeType.CUSTOM, line.token_text)) + attr = gen.lib.Attribute() + attr.set_type((gen.lib.AttributeType.CUSTOM, line.token_text)) attr.set_value(line.data) state.person.add_attribute(attr) self.__skip_subordinate_levels(state.level+1) @@ -1295,7 +1295,7 @@ class GedcomParser(UpdateCallback): @param state: The current state @type state: CurrentState """ - event_ref = self.__build_event_pair(state, RelLib.EventType.CUSTOM, + event_ref = self.__build_event_pair(state, gen.lib.EventType.CUSTOM, self.event_parse_tbl, line.data) state.person.add_event_ref(event_ref) @@ -1326,8 +1326,8 @@ class GedcomParser(UpdateCallback): @param state: The current state @type state: CurrentState """ - attr = RelLib.Attribute() - attr.set_type((RelLib.AttributeType.CUSTOM, 'RESN')) + attr = gen.lib.Attribute() + attr.set_type((gen.lib.AttributeType.CUSTOM, 'RESN')) state.person.add_attribute(attr) def __person_alt_name(self, line, state): @@ -1344,7 +1344,7 @@ class GedcomParser(UpdateCallback): @type state: CurrentState """ name = GedcomUtils.parse_name_personal(line.data) - name.set_type(RelLib.NameType.AKA) + name.set_type(gen.lib.NameType.AKA) state.person.add_alternate_name(name) # Create a new state, and parse the remainder of the NAME level @@ -1377,7 +1377,7 @@ class GedcomParser(UpdateCallback): @type state: CurrentState """ if line.data and line.data[0] == '@': - ref = RelLib.MediaRef() + ref = gen.lib.MediaRef() handle = self.__find_object_handle(line.data[1:-1]) ref.set_reference_handle(handle) state.person.add_media_reference(ref) @@ -1411,7 +1411,7 @@ class GedcomParser(UpdateCallback): @type state: CurrentState """ - # build a RelLib.Name structure from the text + # build a gen.lib.Name structure from the text name = GedcomUtils.parse_name_personal(line.data) @@ -1422,10 +1422,10 @@ class GedcomParser(UpdateCallback): # of different name types if state.name_cnt == 0: - name.set_type(RelLib.NameType.BIRTH) + name.set_type(gen.lib.NameType.BIRTH) state.person.set_primary_name(name) else: - name.set_type(RelLib.NameType.AKA) + name.set_type(gen.lib.NameType.AKA) state.person.add_alternate_name(name) state.name_cnt += 1 @@ -1462,7 +1462,7 @@ class GedcomParser(UpdateCallback): @param state: The current state @type state: CurrentState """ - event_ref = self.__build_event_pair(state, RelLib.EventType.CUSTOM, + event_ref = self.__build_event_pair(state, gen.lib.EventType.CUSTOM, self.event_parse_tbl, line.data) state.person.add_event_ref(event_ref) @@ -1481,7 +1481,7 @@ class GedcomParser(UpdateCallback): event = line.data event.set_gramps_id(self.emapper.find_next()) - event_ref = RelLib.EventRef() + event_ref = gen.lib.EventRef() self.dbase.add_event(event, self.trans) sub_state = GedcomUtils.CurrentState() @@ -1509,7 +1509,7 @@ class GedcomParser(UpdateCallback): @param state: The current state @type state: CurrentState """ - event_ref = self.__build_event_pair(state, RelLib.EventType.RELIGION, + event_ref = self.__build_event_pair(state, gen.lib.EventType.RELIGION, self.event_parse_tbl, line.data) state.person.add_event_ref(event_ref) @@ -1532,7 +1532,7 @@ class GedcomParser(UpdateCallback): @param state: The current state @type state: CurrentState """ - event_ref = self.__build_event_pair(state, RelLib.EventType.BIRTH, + event_ref = self.__build_event_pair(state, gen.lib.EventType.BIRTH, self.event_parse_tbl, line.data) if state.person.get_birth_ref(): state.person.add_event_ref(event_ref) @@ -1554,7 +1554,7 @@ class GedcomParser(UpdateCallback): @param state: The current state @type state: CurrentState """ - event_ref = self.__build_event_pair(state, RelLib.EventType.ADOPT, + event_ref = self.__build_event_pair(state, gen.lib.EventType.ADOPT, self.adopt_parse_tbl, line.data) state.person.add_event_ref(event_ref) @@ -1572,7 +1572,7 @@ class GedcomParser(UpdateCallback): @param state: The current state @type state: CurrentState """ - event_ref = self.__build_event_pair(state, RelLib.EventType.DEATH, + event_ref = self.__build_event_pair(state, gen.lib.EventType.DEATH, self.event_parse_tbl, line.data) if state.person.get_death_ref(): state.person.add_event_ref(event_ref) @@ -1622,7 +1622,7 @@ class GedcomParser(UpdateCallback): """ sub_state = GedcomUtils.CurrentState() sub_state.level = state.level+1 - sub_state.addr = RelLib.Address() + sub_state.addr = gen.lib.Address() sub_state.addr.set_street(line.data) state.person.add_address(sub_state.addr) self.__parse_level(sub_state, self.parse_addr_tbl, self.__ignore) @@ -1636,7 +1636,7 @@ class GedcomParser(UpdateCallback): @param state: The current state @type state: CurrentState """ - addr = RelLib.Address() + addr = gen.lib.Address() addr.set_street("Unknown") addr.set_phone(line.data) state.person.add_address(addr) @@ -1648,10 +1648,10 @@ class GedcomParser(UpdateCallback): @param state: The current state @type state: CurrentState """ - event = RelLib.Event() - event_ref = RelLib.EventRef() + event = gen.lib.Event() + event_ref = gen.lib.EventRef() event.set_gramps_id(self.emapper.find_next()) - event.set_type(RelLib.EventType.NOB_TITLE) + event.set_type(gen.lib.EventType.NOB_TITLE) event.set_description(line.data) sub_state = GedcomUtils.CurrentState() @@ -1685,9 +1685,9 @@ class GedcomParser(UpdateCallback): @type state: CurrentState """ if line.data == "_OTHN": - state.name.set_type(RelLib.NameType.AKA) + state.name.set_type(gen.lib.NameType.AKA) else: - state.name.set_type((RelLib.NameType.CUSTOM, line.data)) + state.name.set_type((gen.lib.NameType.CUSTOM, line.data)) def __name_note(self, line, state): """ @@ -1760,13 +1760,13 @@ class GedcomParser(UpdateCallback): text = line.data.strip() data = text.split() if len(data) == 1: - name = RelLib.Name(state.person.primary_name) + name = gen.lib.Name(state.person.primary_name) name.set_surname(data[0].strip()) - name.set_type(RelLib.NameType.MARRIED) + name.set_type(gen.lib.NameType.MARRIED) state.person.add_alternate_name(name) elif len(data) > 1: name = GedcomUtils.parse_name_personal(text) - name.set_type(RelLib.NameType.MARRIED) + name.set_type(gen.lib.NameType.MARRIED) state.person.add_alternate_name(name) def __name_nsfx(self, line, state): @@ -1787,8 +1787,8 @@ class GedcomParser(UpdateCallback): @param state: The current state @type state: CurrentState """ - attr = RelLib.Attribute() - attr.set_type(RelLib.AttributeType.NICKNAME) + attr = gen.lib.Attribute() + attr.set_type(gen.lib.AttributeType.NICKNAME) attr.set_value(line.data) state.person.add_attribute(attr) self.__skip_subordinate_levels(state.level+1) @@ -1803,12 +1803,12 @@ class GedcomParser(UpdateCallback): lname = line.data.split() name_len = len(lname) if name_len == 1: - attr = RelLib.Attribute() - attr.set_type(RelLib.AttributeType.NICKNAME) + attr = gen.lib.Attribute() + attr.set_type(gen.lib.AttributeType.NICKNAME) attr.set_value(line.data) state.person.add_attribute(attr) else: - name = RelLib.Name() + name = gen.lib.Name() name.set_surname(lname[-1].strip()) name.set_first_name(' '.join(lname[0:name_len-1])) state.person.add_alternate_name(name) @@ -1847,7 +1847,7 @@ class GedcomParser(UpdateCallback): @type state: CurrentState """ - addr = RelLib.Address() + addr = gen.lib.Address() sub_state = GedcomUtils.CurrentState() sub_state.person = state.person @@ -1971,7 +1971,7 @@ class GedcomParser(UpdateCallback): """ sub_state = GedcomUtils.CurrentState() sub_state.person = state.person - sub_state.attr = RelLib.Attribute() + sub_state.attr = gen.lib.Attribute() sub_state.attr.set_value(line.data) sub_state.level = state.level+1 state.person.add_attribute(sub_state.attr) @@ -1991,7 +1991,7 @@ class GedcomParser(UpdateCallback): @param state: The current state @type state: CurrentState """ - self.build_lds_ord(state, RelLib.LdsOrd.BAPTISM) + self.build_lds_ord(state, gen.lib.LdsOrd.BAPTISM) def __person_conl(self, line, state): """ @@ -2002,7 +2002,7 @@ class GedcomParser(UpdateCallback): @param state: The current state @type state: CurrentState """ - self.build_lds_ord(state, RelLib.LdsOrd.CONFIRMATION) + self.build_lds_ord(state, gen.lib.LdsOrd.CONFIRMATION) def __person_endl(self, line, state): """ @@ -2013,7 +2013,7 @@ class GedcomParser(UpdateCallback): @param state: The current state @type state: CurrentState """ - self.build_lds_ord(state, RelLib.LdsOrd.ENDOWMENT) + self.build_lds_ord(state, gen.lib.LdsOrd.ENDOWMENT) def __person_slgc(self, line, state): """ @@ -2024,7 +2024,7 @@ class GedcomParser(UpdateCallback): @param state: The current state @type state: CurrentState """ - self.build_lds_ord(state, RelLib.LdsOrd.SEAL_TO_PARENTS) + self.build_lds_ord(state, gen.lib.LdsOrd.SEAL_TO_PARENTS) def build_lds_ord(self, state, lds_type): """ @@ -2037,7 +2037,7 @@ class GedcomParser(UpdateCallback): """ sub_state = GedcomUtils.CurrentState() sub_state.level = state.level + 1 - sub_state.lds_ord = RelLib.LdsOrd() + sub_state.lds_ord = gen.lib.LdsOrd() sub_state.lds_ord.set_type(lds_type) sub_state.place = None sub_state.place_fields = GedcomUtils.PlaceParser() @@ -2147,7 +2147,7 @@ class GedcomParser(UpdateCallback): @param state: The current state @type state: CurrentState """ - status = GedcomInfo.lds_status.get(line.data, RelLib.LdsOrd.STATUS_NONE) + status = GedcomInfo.lds_status.get(line.data, gen.lib.LdsOrd.STATUS_NONE) state.lds_ord.set_status(status) def __person_famc(self, line, state): @@ -2199,7 +2199,7 @@ class GedcomParser(UpdateCallback): ref.set_father_relation(sub_state.ftype) break else: - ref = RelLib.ChildRef() + ref = gen.lib.ChildRef() ref.ref = state.person.handle if sub_state.ftype: ref.set_mother_relation(sub_state.ftype) @@ -2221,7 +2221,7 @@ class GedcomParser(UpdateCallback): @type state: CurrentState """ state.ftype = PEDIGREE_TYPES.get(line.data.lower(), - RelLib.ChildRefType.UNKNOWN) + gen.lib.ChildRefType.UNKNOWN) def __person_famc_note(self, line, state): """ @@ -2314,7 +2314,7 @@ class GedcomParser(UpdateCallback): sub_state = GedcomUtils.CurrentState() sub_state.person = state.person sub_state.level = state.level + 1 - sub_state.ref = RelLib.PersonRef() + sub_state.ref = gen.lib.PersonRef() sub_state.ref.ref = handle sub_state.ignore = False @@ -2475,8 +2475,8 @@ class GedcomParser(UpdateCallback): """ event = line.data event.set_gramps_id(self.emapper.find_next()) - event_ref = RelLib.EventRef() - event_ref.set_role(RelLib.EventRoleType.FAMILY) + event_ref = gen.lib.EventRef() + event_ref.set_role(gen.lib.EventRoleType.FAMILY) self.dbase.add_event(event, self.trans) sub_state = GedcomUtils.CurrentState() @@ -2487,16 +2487,16 @@ class GedcomParser(UpdateCallback): self.__parse_level(sub_state, self.event_parse_tbl, self.__undefined) - if int(event.get_type()) == RelLib.EventType.MARRIAGE: + if int(event.get_type()) == gen.lib.EventType.MARRIAGE: descr = event.get_description() if descr == "Civil Union": - state.family.type.set(RelLib.FamilyRelType.CIVIL_UNION) + state.family.type.set(gen.lib.FamilyRelType.CIVIL_UNION) event.set_description('') elif descr == "Unmarried": - state.family.type.set(RelLib.FamilyRelType.UNMARRIED) + state.family.type.set(gen.lib.FamilyRelType.UNMARRIED) event.set_description('') else: - state.family.type.set(RelLib.FamilyRelType.MARRIED) + state.family.type.set(gen.lib.FamilyRelType.MARRIED) family_event_name(event, state.family, self.dbase) self.dbase.commit_event(event, self.trans) @@ -2515,9 +2515,9 @@ class GedcomParser(UpdateCallback): @param state: The current state @type state: CurrentState """ - event = RelLib.Event() - event_ref = RelLib.EventRef() - event_ref.set_role(RelLib.EventRoleType.FAMILY) + event = gen.lib.Event() + event_ref = gen.lib.EventRef() + event_ref.set_role(gen.lib.EventRoleType.FAMILY) event.set_gramps_id(self.emapper.find_next()) event.set_type(line.data) self.dbase.add_event(event, self.trans) @@ -2567,7 +2567,7 @@ class GedcomParser(UpdateCallback): if sub_state.mrel: ref.set_mother_relation(sub_state.mrel) else: - ref = RelLib.ChildRef() + ref = gen.lib.ChildRef() ref.ref = child.handle if sub_state.frel: ref.set_father_relation(sub_state.frel) @@ -2592,8 +2592,8 @@ class GedcomParser(UpdateCallback): """ sub_state = GedcomUtils.CurrentState() sub_state.level = state.level + 1 - sub_state.lds_ord = RelLib.LdsOrd() - sub_state.lds_ord.set_type(RelLib.LdsOrd.SEAL_TO_SPOUSE) + sub_state.lds_ord = gen.lib.LdsOrd() + sub_state.lds_ord.set_type(gen.lib.LdsOrd.SEAL_TO_SPOUSE) sub_state.place = None sub_state.family = state.family sub_state.place_fields = GedcomUtils.PlaceParser() @@ -2684,7 +2684,7 @@ class GedcomParser(UpdateCallback): @param state: The current state @type state: CurrentState """ - state.addr = RelLib.Address() + state.addr = gen.lib.Address() state.addr.set_street(line.data) self.__parse_level(state, self.parse_addr_tbl, self.__ignore) @@ -2704,7 +2704,7 @@ class GedcomParser(UpdateCallback): @param state: The current state @type state: CurrentState """ - attr = RelLib.Attribute() + attr = gen.lib.Attribute() attr.set_type(line.token_text) attr.set_value(line.data) state.family.add_attribute(attr) @@ -2853,17 +2853,17 @@ class GedcomParser(UpdateCallback): """ if state.event.get_type().is_custom(): if GED_2_GRAMPS.has_key(line.data): - name = RelLib.EventType(GED_2_GRAMPS[line.data]) + name = gen.lib.EventType(GED_2_GRAMPS[line.data]) else: val = self.gedsource.tag2gramps(line.data) if val: - name = RelLib.EventType((RelLib.EventType.CUSTOM, val)) + name = gen.lib.EventType((gen.lib.EventType.CUSTOM, val)) else: try: - name = RelLib.EventType((RelLib.EventType.CUSTOM, + name = gen.lib.EventType((gen.lib.EventType.CUSTOM, line[3])) except AttributeError: - name = RelLib.EventType(RelLib.EventType.UNKNOWN) + name = gen.lib.EventType(gen.lib.EventType.UNKNOWN) state.event.set_type(name) else: try: @@ -3002,7 +3002,7 @@ class GedcomParser(UpdateCallback): @type state: CurrentState """ sub_state = GedcomUtils.CurrentState(level=state.level+1) - sub_state.location = RelLib.Location() + sub_state.location = gen.lib.Location() sub_state.location.set_street(line.data) sub_state.note = [] sub_state.event = state.event @@ -3063,7 +3063,7 @@ class GedcomParser(UpdateCallback): if line.data[0:13] == "Description: ": state.event.set_description(line.data[13:]) else: - new_note = RelLib.Note(line.data) + new_note = gen.lib.Note(line.data) new_note.set_handle(Utils.create_id()) self.dbase.add_note(new_note, self.trans) self.__skip_subordinate_levels(state.level+2) @@ -3085,8 +3085,8 @@ class GedcomParser(UpdateCallback): @param state: The current state @type state: CurrentState """ - attr = RelLib.Attribute() - attr.set_type(RelLib.AttributeType.CAUSE) + attr = gen.lib.Attribute() + attr.set_type(gen.lib.AttributeType.CAUSE) attr.set_value(line.data) state.event.add_attribute(attr) @@ -3113,8 +3113,8 @@ class GedcomParser(UpdateCallback): @param state: The current state @type state: CurrentState """ - attr = RelLib.Attribute() - attr.set_type(RelLib.AttributeType.AGE) + attr = gen.lib.Attribute() + attr.set_type(gen.lib.AttributeType.AGE) attr.set_value(line.data) state.event_ref.add_attribute(attr) @@ -3130,8 +3130,8 @@ class GedcomParser(UpdateCallback): if self.__level_is_finished(line, state.level): break elif line.token == TOKEN_AGE: - attr = RelLib.Attribute() - attr.set_type(RelLib.AttributeType.FATHER_AGE) + attr = gen.lib.Attribute() + attr.set_type(gen.lib.AttributeType.FATHER_AGE) attr.set_value(line.data) state.event_ref.add_attribute(attr) @@ -3147,8 +3147,8 @@ class GedcomParser(UpdateCallback): if self.__level_is_finished(line, state.level): break elif line.token == TOKEN_AGE: - attr = RelLib.Attribute() - attr.set_type(RelLib.AttributeType.MOTHER_AGE) + attr = gen.lib.Attribute() + attr.set_type(gen.lib.AttributeType.MOTHER_AGE) attr.set_value(line.data) state.event_ref.add_attribute(attr) @@ -3159,8 +3159,8 @@ class GedcomParser(UpdateCallback): @param state: The current state @type state: CurrentState """ - attr = RelLib.Attribute() - attr.set_type(RelLib.AttributeType.AGENCY) + attr = gen.lib.Attribute() + attr.set_type(gen.lib.AttributeType.AGENCY) attr.set_value(line.data) state.event.add_attribute(attr) @@ -3178,7 +3178,7 @@ class GedcomParser(UpdateCallback): # +1 TYPE assert( state.event.handle) # event handle is required to be set wit = self.__find_or_create_person(self.pid_map[line.data]) - event_ref = RelLib.EventRef() + event_ref = gen.lib.EventRef() event_ref.set_reference_handle(state.event.handle) while True: line = self.__get_next_line() @@ -3186,18 +3186,18 @@ class GedcomParser(UpdateCallback): break elif line.token == TOKEN_TYPE: if line.data in ("WITNESS_OF_MARRIAGE"): - role = RelLib.EventRoleType( - RelLib.EventRoleType.WITNESS) + role = gen.lib.EventRoleType( + gen.lib.EventRoleType.WITNESS) else: - role = RelLib.EventRoleType( - (RelLib.EventRoleType.CUSTOM, line.data)) + role = gen.lib.EventRoleType( + (gen.lib.EventRoleType.CUSTOM, line.data)) event_ref.set_role(role) wit.add_event_ref(event_ref) self.dbase.commit_person(wit, self.trans) else: # n _WITN - attr = RelLib.Attribute() - attr.set_type(RelLib.AttributeType.WITNESS) + attr = gen.lib.Attribute() + attr.set_type(gen.lib.AttributeType.WITNESS) attr.set_value(line.data) state.event.add_attribute(attr) @@ -3219,8 +3219,8 @@ class GedcomParser(UpdateCallback): self.__parse_level(sub_state, self.parse_person_adopt, self.__undefined) - if (int(sub_state.mrel) == RelLib.ChildRefType.BIRTH and - int(sub_state.frel) == RelLib.ChildRefType.BIRTH): + if (int(sub_state.mrel) == gen.lib.ChildRefType.BIRTH and + int(sub_state.frel) == gen.lib.ChildRefType.BIRTH): sub_state.mrel = sub_state.frel = TYPE_ADOPT if state.person.get_main_parents_family_handle() == handle: @@ -3234,7 +3234,7 @@ class GedcomParser(UpdateCallback): ref.set_father_relation(sub_state.frel) ref.set_mother_relation(sub_state.mrel) else: - ref = RelLib.ChildRef() + ref = gen.lib.ChildRef() ref.ref = state.person.handle ref.set_father_relation(sub_state.frel) ref.set_mother_relation(sub_state.mrel) @@ -3269,7 +3269,7 @@ class GedcomParser(UpdateCallback): state.person.set_main_parent_family_handle(None) state.person.add_parent_family_handle(handle) - frel = mrel = RelLib.ChildRefType.BIRTH + frel = mrel = gen.lib.ChildRefType.BIRTH family = self.dbase.find_family_from_handle(handle, self.trans) reflist = [ ref for ref in family.get_child_ref_list() \ @@ -3279,7 +3279,7 @@ class GedcomParser(UpdateCallback): ref.set_father_relation(frel) ref.set_mother_relation(mrel) else: - ref = RelLib.ChildRef() + ref = gen.lib.ChildRef() ref.ref = state.person.handle ref.set_father_relation(frel) ref.set_mother_relation(mrel) @@ -3414,21 +3414,21 @@ class GedcomParser(UpdateCallback): state.src_ref.set_date_object(line.data) def __source_text(self, line, state): - note = RelLib.Note() + note = gen.lib.Note() note.set(line.data) gramps_id = self.dbase.find_next_note_gramps_id() note.set_gramps_id(gramps_id) - note.set_type(RelLib.NoteType.SOURCE_TEXT) + note.set_type(gen.lib.NoteType.SOURCE_TEXT) self.dbase.add_note(note, self.trans) state.source.add_note(note.get_handle()) def __srcref_data_text(self, line, state): - note = RelLib.Note() + note = gen.lib.Note() note.set(line.data) gramps_id = self.dbase.find_next_note_gramps_id() note.set_gramps_id(gramps_id) - note.set_type(RelLib.NoteType.SOURCE_TEXT) + note.set_type(gen.lib.NoteType.SOURCE_TEXT) self.dbase.add_note(note, self.trans) state.src_ref.add_note(note.get_handle()) @@ -3583,7 +3583,7 @@ class GedcomParser(UpdateCallback): self.repo2id[line.data] = repo.get_gramps_id() repo.set_name(line.data) self.dbase.commit_repository(repo, self.trans) - repo_ref = RelLib.RepoRef() + repo_ref = gen.lib.RepoRef() repo_ref.set_reference_handle(repo.handle) sub_state = GedcomUtils.CurrentState() @@ -3607,7 +3607,7 @@ class GedcomParser(UpdateCallback): def __repo_ref_medi(self, line, state): name = line.data mtype = MEDIA_MAP.get(name.lower(), - (RelLib.SourceMediaType.CUSTOM, name)) + (gen.lib.SourceMediaType.CUSTOM, name)) state.repo_ref.set_media_type(mtype) def __repo_ref_note(self, line, state): @@ -3635,8 +3635,8 @@ class GedcomParser(UpdateCallback): @param state: The current state @type state: CurrentState """ - attr = RelLib.Attribute() - attr.set_type(RelLib.AttributeType.AGENCY) + attr = gen.lib.Attribute() + attr.set_type(gen.lib.AttributeType.AGENCY) attr.set_value(line.data) state.source.add_attribute(attr) @@ -3910,7 +3910,7 @@ class GedcomParser(UpdateCallback): if this happened, and try to fix it. """ - addr = RelLib.Address() + addr = gen.lib.Address() addr.set_street(line.data) sub_state = GedcomUtils.CurrentState() @@ -3957,7 +3957,7 @@ class GedcomParser(UpdateCallback): @type state: CurrentState """ if not state.location: - state.location = RelLib.Location() + state.location = gen.lib.Location() val = state.location.get_street() if val: val = "%s, %s" % (val, line.data.strip()) @@ -3973,7 +3973,7 @@ class GedcomParser(UpdateCallback): @type state: CurrentState """ if not state.location: - state.location = RelLib.Location() + state.location = gen.lib.Location() state.location.set_date_object(line.data) def __location_city(self, line, state): @@ -3984,7 +3984,7 @@ class GedcomParser(UpdateCallback): @type state: CurrentState """ if not state.location: - state.location = RelLib.Location() + state.location = gen.lib.Location() state.location.set_city(line.data) def __location_stae(self, line, state): @@ -3995,7 +3995,7 @@ class GedcomParser(UpdateCallback): @type state: CurrentState """ if not state.location: - state.location = RelLib.Location() + state.location = gen.lib.Location() state.location.set_state(line.data) def __location_post(self, line, state): @@ -4006,7 +4006,7 @@ class GedcomParser(UpdateCallback): @type state: CurrentState """ if not state.location: - state.location = RelLib.Location() + state.location = gen.lib.Location() state.location.set_postal_code(line.data) def __location_ctry(self, line, state): @@ -4017,7 +4017,7 @@ class GedcomParser(UpdateCallback): @type state: CurrentState """ if not state.location: - state.location = RelLib.Location() + state.location = gen.lib.Location() state.location.set_country(line.data) def __location_note(self, line, state): @@ -4028,7 +4028,7 @@ class GedcomParser(UpdateCallback): @type state: CurrentState """ if not state.location: - state.location = RelLib.Location() + state.location = gen.lib.Location() self.__parse_note(line, state.event, state.level+1) def map_ancestry_com(self, person, original_gid): @@ -4191,14 +4191,14 @@ class GedcomParser(UpdateCallback): gid = line.data.strip() obj.add_note(self.__find_note_handle(self.nid_map[gid])) else: - new_note = RelLib.Note(line.data) + new_note = gen.lib.Note(line.data) new_note.set_handle(Utils.create_id()) self.dbase.add_note(new_note, self.trans) self.__skip_subordinate_levels(level+1) obj.add_note(new_note.get_handle()) def __parse_inline_note(self, line, level): - new_note = RelLib.Note(line.data) + new_note = gen.lib.Note(line.data) gid = self.nid_map[line.token_text] handle = self.nid2id.get(gid) new_note.set_handle(handle) @@ -4234,11 +4234,11 @@ class GedcomParser(UpdateCallback): Handles the specified source, building a source reference to the object. """ - source_ref = RelLib.SourceRef() + source_ref = gen.lib.SourceRef() if line.data and line.data[0] != "@": title = line.data handle = self.inline_srcs.get(title, Utils.create_id()) - src = RelLib.Source() + src = gen.lib.Source() src.handle = handle src.gramps_id = self.dbase.find_next_source_gramps_id() self.inline_srcs[title] = handle @@ -4298,10 +4298,10 @@ class GedcomParser(UpdateCallback): def build_media_object(self, obj, form, filename, title, note): if form == "url": - url = RelLib.Url() + url = gen.lib.Url() url.set_path(filename) url.set_description(title) - url.set_type(RelLib.UrlType.WEB_HOME) + url.set_type(gen.lib.UrlType.WEB_HOME) obj.add_url(url) else: (valid, path) = self.__find_file(filename, self.dir_path) @@ -4310,7 +4310,7 @@ class GedcomParser(UpdateCallback): path = filename.replace('\\', os.path.sep) photo_handle = self.media_map.get(path) if photo_handle == None: - photo = RelLib.MediaObject() + photo = gen.lib.MediaObject() photo.set_path(path) photo.set_description(title) full_path = os.path.abspath(path) @@ -4322,7 +4322,7 @@ class GedcomParser(UpdateCallback): self.media_map[path] = photo.handle else: photo = self.dbase.get_object_from_handle(photo_handle) - oref = RelLib.MediaRef() + oref = gen.lib.MediaRef() oref.set_reference_handle(photo.handle) oref.add_note(note) obj.add_media_reference(oref) @@ -4340,8 +4340,8 @@ class GedcomParser(UpdateCallback): n <> {0:M} p.*, * n <> {0:M} p. """ - event = RelLib.Event() - event_ref = RelLib.EventRef() + event = gen.lib.Event() + event_ref = gen.lib.EventRef() event.set_gramps_id(self.emapper.find_next()) event.set_type(event_type) @@ -4365,8 +4365,8 @@ class GedcomParser(UpdateCallback): def __build_family_event_pair(self, state, event_type, event_map, description): - event = RelLib.Event() - event_ref = RelLib.EventRef() + event = gen.lib.Event() + event_ref = gen.lib.EventRef() event.set_gramps_id(self.emapper.find_next()) event.set_type(event_type) if description and description != 'Y': @@ -4416,7 +4416,7 @@ class GedcomParser(UpdateCallback): Adds the default source to the object. """ if self.use_def_src and len(obj.get_source_references()) == 0: - sref = RelLib.SourceRef() + sref = gen.lib.SourceRef() sref.set_reference_handle(self.def_src.handle) obj.add_source_reference(sref) diff --git a/src/GrampsDbUtils/_GedcomUtils.py b/src/GrampsDbUtils/_GedcomUtils.py index e4e91f6a9..92a249945 100644 --- a/src/GrampsDbUtils/_GedcomUtils.py +++ b/src/GrampsDbUtils/_GedcomUtils.py @@ -23,7 +23,7 @@ Support classes to simplify GEDCOM importing """ import re -import RelLib +import gen.lib NAME_RE = re.compile(r"/?([^/]*)(/([^/]*)(/([^/]*))?)?") SURNAME_RE = re.compile(r"/([^/]*)/([^/]*)") @@ -73,20 +73,20 @@ class PlaceParser: """ __field_map = { - 'addr' : RelLib.Location.set_street, - 'subdivision' : RelLib.Location.set_street, - 'addr1' : RelLib.Location.set_street, - 'adr1' : RelLib.Location.set_street, - 'city' : RelLib.Location.set_city, - 'town' : RelLib.Location.set_city, - 'village' : RelLib.Location.set_city, - 'county' : RelLib.Location.set_county, - 'country' : RelLib.Location.set_country, - 'state' : RelLib.Location.set_state, - 'state/province': RelLib.Location.set_state, - 'region' : RelLib.Location.set_state, - 'province' : RelLib.Location.set_state, - 'area code' : RelLib.Location.set_postal_code, + 'addr' : gen.lib.Location.set_street, + 'subdivision' : gen.lib.Location.set_street, + 'addr1' : gen.lib.Location.set_street, + 'adr1' : gen.lib.Location.set_street, + 'city' : gen.lib.Location.set_city, + 'town' : gen.lib.Location.set_city, + 'village' : gen.lib.Location.set_city, + 'county' : gen.lib.Location.set_county, + 'country' : gen.lib.Location.set_country, + 'state' : gen.lib.Location.set_state, + 'state/province': gen.lib.Location.set_state, + 'region' : gen.lib.Location.set_state, + 'province' : gen.lib.Location.set_state, + 'area code' : gen.lib.Location.set_postal_code, } def __init__(self, line=None): @@ -99,7 +99,7 @@ class PlaceParser: """ Parses the GEDCOM PLAC.FORM into a list of function pointers (if possible). It does this my mapping the text strings - (separated by commas) to the corresponding RelLib.Location + (separated by commas) to the corresponding gen.lib.Location method via the __field_map variable """ for item in line.data.split(','): @@ -203,7 +203,7 @@ def parse_name_personal(text): """ Parses a GEDCOM NAME value into an Name structure """ - name = RelLib.Name() + name = gen.lib.Name() match = SURNAME_RE.match(text) if match: diff --git a/src/GrampsDbUtils/_ReadXML.py b/src/GrampsDbUtils/_ReadXML.py index 8ad0df4e6..dfd9d75d6 100644 --- a/src/GrampsDbUtils/_ReadXML.py +++ b/src/GrampsDbUtils/_ReadXML.py @@ -40,7 +40,7 @@ import re #------------------------------------------------------------------------- from QuestionDialog import ErrorDialog import Mime -import RelLib +import gen.lib import const import Utils import DateHandler @@ -64,12 +64,12 @@ except: PERSON_RE = re.compile(r"\s*\ 0: nickname = nicknames[0] else: @@ -582,9 +582,9 @@ class GedcomWriter(BasicUtils.UpdateCallback): male or female, simply do not output anything. The only valid values are M (male) or F (female). So if the geneder is unknown, we output nothing. """ - if person.get_gender() == RelLib.Person.MALE: + if person.get_gender() == gen.lib.Person.MALE: self.__writeln(1, "SEX", "M") - elif person.get_gender() == RelLib.Person.FEMALE: + elif person.get_gender() == gen.lib.Person.FEMALE: self.__writeln(1, "SEX", "F") def __lds_ords(self, obj, level): @@ -606,7 +606,7 @@ class GedcomWriter(BasicUtils.UpdateCallback): etype = int(event.get_type()) # if the event is a birth or death, skip it. - if etype in (RelLib.EventType.BIRTH, RelLib.EventType.DEATH): + if etype in (gen.lib.EventType.BIRTH, gen.lib.EventType.DEATH): continue val = GedcomInfo.personalConstantEvents.get(etype, "").strip() @@ -654,8 +654,8 @@ class GedcomWriter(BasicUtils.UpdateCallback): for fh in person.get_parent_family_handle_list() ]: for child_ref in [ ref for ref in family.get_child_ref_list() if ref.ref == person.handle ]: - if child_ref.mrel == RelLib.ChildRefType.ADOPTED \ - or child_ref.frel == RelLib.ChildRefType.ADOPTED: + if child_ref.mrel == gen.lib.ChildRefType.ADOPTED \ + or child_ref.frel == gen.lib.ChildRefType.ADOPTED: adoptions.append((family, child_ref.frel, child_ref.mrel)) for (fam, frel, mrel) in adoptions: @@ -663,7 +663,7 @@ class GedcomWriter(BasicUtils.UpdateCallback): self.__writeln(2, 'FAMC', '@%s@' % fam.get_gramps_id()) if mrel == frel: self.__writeln(3, 'ADOP', 'BOTH') - elif mrel == RelLib.ChildRefType.ADOPTED: + elif mrel == gen.lib.ChildRefType.ADOPTED: self.__writeln(3, 'ADOP', 'WIFE') else: self.__writeln(3, 'ADOP', 'HUSB') @@ -680,7 +680,7 @@ class GedcomWriter(BasicUtils.UpdateCallback): # filter out the nicknames attr_list = [ attr for attr in person.get_attribute_list() - if attr.get_type() != RelLib.AttributeType.NICKNAME ] + if attr.get_type() != gen.lib.AttributeType.NICKNAME ] for attr in attr_list: @@ -882,9 +882,9 @@ class GedcomWriter(BasicUtils.UpdateCallback): else: self.__writeln(1, val, 'Y') - if event.get_type() == RelLib.EventType.MARRIAGE: + if event.get_type() == gen.lib.EventType.MARRIAGE: ftype = family.get_relationship() - if ftype != RelLib.FamilyRelType.MARRIED and str(ftype): + if ftype != gen.lib.FamilyRelType.MARRIED and str(ftype): self.__writeln(2, 'TYPE', str(ftype)) self.__family_event_attrs(event.get_attribute_list(), 2) @@ -908,10 +908,10 @@ class GedcomWriter(BasicUtils.UpdateCallback): to WIFE/HUSB AGE attributes. """ for attr in attr_list: - if attr.get_type() == RelLib.AttributeType.FATHER_AGE: + if attr.get_type() == gen.lib.AttributeType.FATHER_AGE: self.__writeln(level, 'HUSB') self.__writeln(level+1, 'AGE', attr.get_value()) - elif attr.get_type() == RelLib.AttributeType.MOTHER_AGE: + elif attr.get_type() == gen.lib.AttributeType.MOTHER_AGE: self.__writeln(level, 'WIFE') self.__writeln(level+1, 'AGE', attr.get_value()) @@ -1111,19 +1111,19 @@ class GedcomWriter(BasicUtils.UpdateCallback): for attr in event.get_attribute_list(): attr_type = attr.get_type() - if attr_type == RelLib.AttributeType.CAUSE: + if attr_type == gen.lib.AttributeType.CAUSE: self.__writeln(2, 'CAUS', attr.get_value()) - elif attr_type == RelLib.AttributeType.AGENCY: + elif attr_type == gen.lib.AttributeType.AGENCY: self.__writeln(2, 'AGNC', attr.get_value()) for attr in event_ref.get_attribute_list(): attr_type = attr.get_type() - if attr_type == RelLib.AttributeType.AGE: + if attr_type == gen.lib.AttributeType.AGE: self.__writeln(2, 'AGE', attr.get_value()) - elif attr_type == RelLib.AttributeType.FATHER_AGE: + elif attr_type == gen.lib.AttributeType.FATHER_AGE: self.__writeln(2, 'HUSB') self.__writeln(3, 'AGE', attr.get_value()) - elif attr_type == RelLib.AttributeType.MOTHER_AGE: + elif attr_type == gen.lib.AttributeType.MOTHER_AGE: self.__writeln(2, 'WIFE') self.__writeln(3, 'AGE', attr.get_value()) @@ -1180,7 +1180,7 @@ class GedcomWriter(BasicUtils.UpdateCallback): if lds_ord.get_place_handle(): self.__place( self.dbase.get_place_from_handle(lds_ord.get_place_handle()), 2) - if lds_ord.get_status() != RelLib.LdsOrd.STATUS_NONE: + if lds_ord.get_status() != gen.lib.LdsOrd.STATUS_NONE: self.__writeln(2, 'STAT', LDS_STATUS[lds_ord.get_status()]) self.__note_references(lds_ord.get_note_list(), index+1) @@ -1192,14 +1192,14 @@ class GedcomWriter(BasicUtils.UpdateCallback): expected formta. """ start = date.get_start_date() - if start != RelLib.Date.EMPTY: + if start != gen.lib.Date.EMPTY: cal = date.get_calendar() mod = date.get_modifier() - if date.get_modifier() == RelLib.Date.MOD_SPAN: + if date.get_modifier() == gen.lib.Date.MOD_SPAN: val = "FROM %s TO %s" % ( make_date(start, cal, mod), make_date(date.get_stop_date(), cal, mod)) - elif date.get_modifier() == RelLib.Date.MOD_RANGE: + elif date.get_modifier() == gen.lib.Date.MOD_RANGE: val = "BET %s AND %s" % ( make_date(start, cal, mod), make_date(date.get_stop_date(), cal, mod)) @@ -1287,8 +1287,8 @@ class GedcomWriter(BasicUtils.UpdateCallback): if ref.get_page() != "": self.__writeln(level+1, 'PAGE', ref.get_page()) - conf = min(ref.get_confidence_level(), RelLib.SourceRef.CONF_VERY_HIGH) - if conf != RelLib.SourceRef.CONF_NORMAL and conf != -1: + conf = min(ref.get_confidence_level(), gen.lib.SourceRef.CONF_VERY_HIGH) + if conf != gen.lib.SourceRef.CONF_NORMAL and conf != -1: self.__writeln(level+1, "QUAY", QUALITY_MAP[conf]) if len(ref.get_note_list()) > 0: @@ -1296,7 +1296,7 @@ class GedcomWriter(BasicUtils.UpdateCallback): note_list = [ self.dbase.get_note_from_handle(h) for h in ref.get_note_list() ] note_list = [ n for n in note_list - if n.get_type() == RelLib.NoteType.SOURCE_TEXT] + if n.get_type() == gen.lib.NoteType.SOURCE_TEXT] if note_list: ref_text = note_list[0].get() @@ -1312,7 +1312,7 @@ class GedcomWriter(BasicUtils.UpdateCallback): note_list = [ self.dbase.get_note_from_handle(h) for h in ref.get_note_list() ] note_list = [ n.handle for n in note_list - if n.get_type() != RelLib.NoteType.SOURCE_TEXT] + if n.get_type() != gen.lib.NoteType.SOURCE_TEXT] self.__note_references(note_list, level+1) def __photo(self, photo, level): diff --git a/src/GrampsWidgets.py b/src/GrampsWidgets.py index e0852c86d..1b2db7e93 100644 --- a/src/GrampsWidgets.py +++ b/src/GrampsWidgets.py @@ -791,7 +791,7 @@ class PlaceEntry: self.obj.set_text(u'') self.set_button(False) else: - from RelLib import Place + from gen.lib import Place from Editors import EditPlace place = Place() diff --git a/src/Merge/_MergePerson.py b/src/Merge/_MergePerson.py index d94488816..7ce136a96 100644 --- a/src/Merge/_MergePerson.py +++ b/src/Merge/_MergePerson.py @@ -40,7 +40,7 @@ import pango # GRAMPS modules # #------------------------------------------------------------------------- -import RelLib +import gen.lib from ReportBase import ReportUtils from BasicUtils import name_displayer import const @@ -380,7 +380,7 @@ class MergePeople: self.debug_person(self.p1, "P1") self.debug_person(self.p2, "P2") - new = RelLib.Person() + new = gen.lib.Person() trans = self.db.transaction_begin() self.merge_person_information(new, trans) @@ -460,7 +460,7 @@ class MergePeople: to the merged person as an attribute. """ # copy of GRAMPS ID as an attribute - attr = RelLib.Attribute() + attr = gen.lib.Attribute() attr.set_type('Merged GRAMPS ID') attr.set_value(self.p2.get_gramps_id()) new.add_attribute(attr) @@ -598,7 +598,7 @@ class MergePeople: for child_ref in orig_ref_list: if child_ref.ref == old_handle: if new_handle not in [ref.ref for ref in new_ref_list]: - new_ref = RelLib.ChildRef() + new_ref = gen.lib.ChildRef() new_ref.ref = new_handle new_ref_list.append(new_ref) elif child_ref.ref not in [ref.ref for ref in new_ref_list]: @@ -686,7 +686,7 @@ class MergePeople: ## cursor = self.db.get_family_cursor() ## data = cursor.first() ## while data: -## fam = RelLib.Family() +## fam = gen.lib.Family() ## fam.unserialize(data[1]) ## if self.p2 in [ref.ref for ref in fam.get_child_ref_list()]: ## fam.remove_child_ref(self.p2) @@ -737,7 +737,7 @@ class MergePeople: # data[2] == father_handle field, data[2] == mother_handle field (thandle, data) = node if data[2] == fhandle and data[3] == mhandle and thandle != family_handle: - myfamily = RelLib.Family() + myfamily = gen.lib.Family() myfamily.unserialize(data) break node = cursor.next() diff --git a/src/Models/_FastFilterModel.py b/src/Models/_FastFilterModel.py index 0c48a28d2..3ee424174 100644 --- a/src/Models/_FastFilterModel.py +++ b/src/Models/_FastFilterModel.py @@ -29,7 +29,7 @@ class FastFilterModel(gtk.GenericTreeModel): @ivar _table: main table to be displayed @ivar _cursor: cursor for accessing the table. @ivar _obj_class: the class of the object that is being pulled from - the database. This should probably be one of the primary RelLib + the database. This should probably be one of the primary gen.lib classes. @ivar _num_children_cache: dictionary to hold the number of children for each primary record so that we don't have to look diff --git a/src/Models/_FastModel.py b/src/Models/_FastModel.py index 0ca539c07..ae1f06aa7 100644 --- a/src/Models/_FastModel.py +++ b/src/Models/_FastModel.py @@ -29,7 +29,7 @@ class FastModel(gtk.GenericTreeModel): @ivar _table: main table to be displayed @ivar _cursor: cursor for accessing the table. @ivar _obj_class: the class of the object that is being pulled from - the database. This should probably be one of the primary RelLib + the database. This should probably be one of the primary gen.lib classes. @ivar _num_children_cache: dictionary to hold the number of children for each primary record so that we don't have to look diff --git a/src/Models/_PersonFilterModel.py b/src/Models/_PersonFilterModel.py index 25692cc77..f5d05a55f 100644 --- a/src/Models/_PersonFilterModel.py +++ b/src/Models/_PersonFilterModel.py @@ -10,7 +10,7 @@ from _PathCursor import PathCursor from _ListCursor import ListCursor from _FastFilterModel import FastFilterModel -import RelLib +import gen.lib class PersonFilterModel(FastFilterModel): @@ -22,7 +22,7 @@ class PersonFilterModel(FastFilterModel): def _get_object_class(self,db): - return RelLib.Person + return gen.lib.Person def _get_fetch_func(self,db): diff --git a/src/Models/_PersonListModel.py b/src/Models/_PersonListModel.py index dd5fe1f02..3f7d15361 100644 --- a/src/Models/_PersonListModel.py +++ b/src/Models/_PersonListModel.py @@ -10,7 +10,7 @@ from _PathCursor import PathCursor from _ListCursor import ListCursor from _FastModel import FastModel -import RelLib +import gen.lib class PersonListModel(FastModel): @@ -27,7 +27,7 @@ class PersonListModel(FastModel): return ListCursor(db.surnames.cursor()) def _get_object_class(self,db): - return RelLib.Person + return gen.lib.Person def _get_length(self,db): return self._table.stat()['ndata'] diff --git a/src/Models/_PersonTreeModel.py b/src/Models/_PersonTreeModel.py index 18c494bc1..2dae95d5e 100644 --- a/src/Models/_PersonTreeModel.py +++ b/src/Models/_PersonTreeModel.py @@ -10,7 +10,7 @@ from _PathCursor import PathCursor from _ListCursor import ListCursor from _FastModel import FastModel -import RelLib +import gen.lib class PersonTreeModel(FastModel): @@ -27,7 +27,7 @@ class PersonTreeModel(FastModel): return PathCursor(db.surnames.cursor()) def _get_object_class(self,db): - return RelLib.Person + return gen.lib.Person def _get_length(self,db): return self._table.stat()['nkeys'] diff --git a/src/ObjectSelector/_PersonFilterFrame.py b/src/ObjectSelector/_PersonFilterFrame.py index c68291121..523da944e 100644 --- a/src/ObjectSelector/_PersonFilterFrame.py +++ b/src/ObjectSelector/_PersonFilterFrame.py @@ -29,7 +29,7 @@ log = getLogger(".ObjectSelector") from _FilterFrameBase import FilterFrameBase from Filters import GenericFilter, Rules -import RelLib +import gen.lib class PersonFilterFrame(FilterFrameBase): @@ -57,9 +57,9 @@ class PersonFilterFrame(FilterFrameBase): self.make_text_widget("Name") # Gender - genders=[[_("Male"),RelLib.Person.MALE], - [_("Female"),RelLib.Person.FEMALE], - [_("Unknown"),RelLib.Person.UNKNOWN]] + genders=[[_("Male"),gen.lib.Person.MALE], + [_("Female"),gen.lib.Person.FEMALE], + [_("Unknown"),gen.lib.Person.UNKNOWN]] self._gender_list = gtk.ListStore(str,int) @@ -190,11 +190,11 @@ class PersonFilterFrame(FilterFrameBase): if self._gender_check.get_active(): gender = self._gender_list.get_value(self._gender_combo.get_active_iter(),1) - if gender == RelLib.Person.MALE: + if gender == gen.lib.Person.MALE: filter.add_rule(Rules.Person.IsMale([])) - elif gender == RelLib.Person.FEMALE: + elif gender == gen.lib.Person.FEMALE: filter.add_rule(Rules.Person.IsFemale([])) - elif gender == RelLib.Person.UNKNOWN: + elif gender == gen.lib.Person.UNKNOWN: filter.add_rule(Rules.Person.HasUnknownGender([])) else: log.warn("Received unknown gender from filter widget") diff --git a/src/ObjectSelector/_PersonFrame.py b/src/ObjectSelector/_PersonFrame.py index f14e2ba85..11de13be5 100644 --- a/src/ObjectSelector/_PersonFrame.py +++ b/src/ObjectSelector/_PersonFrame.py @@ -27,7 +27,7 @@ sys.path.append("..") import gtk import gobject -from RelLib import Person +from gen.lib import Person from BasicUtils import name_displayer display_name = name_displayer.display diff --git a/src/ObjectSelector/__init__.py b/src/ObjectSelector/__init__.py index 6c8809763..1ecbdd90f 100644 --- a/src/ObjectSelector/__init__.py +++ b/src/ObjectSelector/__init__.py @@ -49,7 +49,7 @@ The class hierachy is currently this: ObjectFrameFactory -To implement a selector for a new Primary RelLib type you need to implement a new +To implement a selector for a new Primary gen.lib type you need to implement a new subclass of each of: FilterFrameBase diff --git a/src/RelLib/Makefile.am b/src/RelLib/Makefile.am deleted file mode 100644 index eabec12f3..000000000 --- a/src/RelLib/Makefile.am +++ /dev/null @@ -1,79 +0,0 @@ -# This is the src/RelLib level Makefile for Gramps -# We could use GNU make's ':=' syntax for nice wildcard use, -# but that is not necessarily portable. -# If not using GNU make, then list all .py files individually - -pkgdatadir = $(datadir)/@PACKAGE@/RelLib - -pkgdata_PYTHON = \ - _AddressBase.py\ - _Address.py\ - _AttributeBase.py\ - _Attribute.py\ - _BaseObject.py\ - _BasicPrimaryObject.py\ - _CalSdn.py \ - _Date.py \ - _DateBase.py\ - _Event.py\ - _EventType.py\ - _EventRef.py\ - _Family.py\ - _GenderStats.py\ - _GrampsType.py\ - __init__.py\ - _LdsOrdBase.py\ - _LdsOrd.py\ - _LocationBase.py\ - _Location.py\ - _MediaBase.py\ - _MediaObject.py\ - _MediaRef.py\ - _Name.py\ - _NameType.py\ - _NoteType.py\ - _NoteBase.py\ - _Note.py\ - _Person.py\ - _PersonRef.py\ - _PlaceBase.py\ - _Place.py\ - _PrimaryObject.py\ - _PrivacyBase.py\ - _PrivateSourceNote.py\ - _RepoRef.py\ - _Repository.py\ - _RepositoryType.py\ - _Researcher.py\ - _SecondaryObject.py\ - _SourceNote.py\ - _Source.py\ - _SourceRef.py\ - _UrlBase.py\ - _UrlType.py\ - _Url.py\ - _Witness.py\ - _SourceBase.py\ - _RefBase.py\ - _ChildRef.py\ - _AttributeType.py\ - _ChildRefType.py\ - _FamilyRelType.py\ - _SourceMediaType.py\ - _MarkerType.py\ - _EventRoleType.py - -pkgpyexecdir = @pkgpyexecdir@/RelLib -pkgpythondir = @pkgpythondir@/RelLib - -# Clean up all the byte-compiled files -MOSTLYCLEANFILES = *pyc *pyo - -GRAMPS_PY_MODPATH = "../" - -pycheck: - (export PYTHONPATH=$(GRAMPS_PY_MODPATH); \ - pychecker $(pkgdata_PYTHON)); - -pylint: - pylint --disable-msg=W0403,C0103 $(pkgdata_PYTHON) diff --git a/src/RelLib/_PrimaryObject.py b/src/RelLib/_PrimaryObject.py deleted file mode 100644 index c0ad0fdfe..000000000 --- a/src/RelLib/_PrimaryObject.py +++ /dev/null @@ -1,153 +0,0 @@ -# -# Gramps - a GTK+/GNOME based genealogy program -# -# Copyright (C) 2000-2007 Donald N. Allingham -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -# $Id$ - -""" -Primary Object class for GRAMPS -""" - -__revision__ = "$Revision$" - -#------------------------------------------------------------------------- -# -# standard python modules -# -#------------------------------------------------------------------------- -import time -import GrampsLocale - -#------------------------------------------------------------------------- -# -# GRAMPS modules -# -#------------------------------------------------------------------------- -from _BasicPrimaryObject import BasicPrimaryObject -from _SourceBase import SourceBase -from _MediaBase import MediaBase - -#------------------------------------------------------------------------- -# -# Localized constants -# -#------------------------------------------------------------------------- -_codeset = GrampsLocale.codeset - -#------------------------------------------------------------------------- -# -# Primary Object class -# -#------------------------------------------------------------------------- -class PrimaryObject(BasicPrimaryObject): - """ - The PrimaryObject is the base class for all primary objects in the - database. Primary objects are the core objects in the database. - Each object has a database handle and a GRAMPS ID value. The database - handle is used as the record number for the database, and the GRAMPS - ID is the user visible version. - """ - - def __init__(self, source=None): - """ - Initialize a PrimaryObject. If source is None, both the ID and handle - are assigned as empty strings. If source is not None, then object - is initialized from values of the source object. - - @param source: Object used to initialize the new object - @type source: PrimaryObject - """ - BasicPrimaryObject.__init__(self, source) - - def has_handle_reference(self, classname, handle): - """ - Returns True if the object has reference to a given handle - of given primary object type. - - @param classname: The name of the primary object class. - @type classname: str - @param handle: The handle to be checked. - @type handle: str - @return: Returns whether the object has reference to this handle of this object type. - @rtype: bool - """ - if classname == 'Source' and isinstance(self, SourceBase): - return self.has_source_reference(handle) - elif classname == 'MediaObject' and isinstance(self, MediaBase): - return self.has_media_reference(handle) - else: - return self._has_handle_reference(classname, handle) - - def remove_handle_references(self, classname, handle_list): - """ - Removes all references in this object to object handles in the list. - - @param classname: The name of the primary object class. - @type classname: str - @param handle_list: The list of handles to be removed. - @type handle_list: str - """ - if classname == 'Source' and isinstance(self, SourceBase): - self.remove_source_references(handle_list) - elif classname == 'MediaObject' and isinstance(self, MediaBase): - self.remove_media_references(handle_list) - else: - self._remove_handle_references(classname, handle_list) - - def replace_handle_reference(self, classname, old_handle, new_handle): - """ - Replaces all references to old handle with those to the new handle. - - @param classname: The name of the primary object class. - @type classname: str - @param old_handle: The handle to be replaced. - @type old_handle: str - @param new_handle: The handle to replace the old one with. - @type new_handle: str - """ - if classname == 'Source' and isinstance(self, SourceBase): - self.replace_source_references(old_handle, new_handle) - elif classname == 'MediaObject' and isinstance(self, MediaBase): - self.replace_media_references(old_handle, new_handle) - else: - self._replace_handle_reference(classname, old_handle, new_handle) - - def _has_handle_reference(self, classname, handle): - """ - returns True if the handle is referenced by the object - """ - return False - - def _remove_handle_references(self, classname, handle_list): - """ - removes the handle references from the object - """ - pass - - def _replace_handle_reference(self, classname, old_handle, new_handle): - """ - replaces the handle reference with the new reference - """ - pass - - def set_marker(self, marker): - self.marker.set(marker) - - def get_marker(self): - return self.marker diff --git a/src/RelLib/__init__.py b/src/RelLib/__init__.py deleted file mode 100644 index 9b4967853..000000000 --- a/src/RelLib/__init__.py +++ /dev/null @@ -1,75 +0,0 @@ -# -# Gramps - a GTK+/GNOME based genealogy program -# -# Copyright (C) 2000-2006 Donald N. Allingham -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -# $Id$ - -"""The core library of GRAMPS objects""" - -__author__ = "Donald N. Allingham" -__version__ = "$Revision$" -__revision__ = "$Revision$" - -# Dates -from _Date import Date, DateError - -# Secondary objects -from _SecondaryObject import SecondaryObject -from _Address import Address -from _Location import Location -from _Attribute import Attribute -from _EventRef import EventRef -from _LdsOrd import LdsOrd -from _MediaRef import MediaRef -from _Name import Name -from _Note import Note -from _RepoRef import RepoRef -from _SourceRef import SourceRef -from _Url import Url -from _Witness import Witness -from _ChildRef import ChildRef - -# Primary objects -from _PrimaryObject import PrimaryObject -from _Person import Person -from _PersonRef import PersonRef -from _Family import Family -from _Event import Event -from _Place import Place -from _Source import Source -from _MediaObject import MediaObject -from _Repository import Repository - -# These are actually metadata -from _GenderStats import GenderStats -from _Researcher import Researcher - -# Type classes -from _GrampsType import GrampsType -from _NameType import NameType -from _AttributeType import AttributeType -from _UrlType import UrlType -from _ChildRefType import ChildRefType -from _RepositoryType import RepositoryType -from _EventType import EventType -from _FamilyRelType import FamilyRelType -from _SourceMediaType import SourceMediaType -from _EventRoleType import EventRoleType -from _MarkerType import MarkerType -from _NoteType import NoteType diff --git a/src/Relationship.py b/src/Relationship.py index 15b3139e1..05d006c2c 100644 --- a/src/Relationship.py +++ b/src/Relationship.py @@ -26,7 +26,7 @@ # #------------------------------------------------------------------------- -import RelLib +import gen.lib import types from TransUtils import sgettext as _ @@ -304,49 +304,49 @@ class RelationshipCalculator: family.get_mother_handle()]: family_rel = family.get_relationship() # Determine person's gender - if other.get_gender() == RelLib.Person.MALE: - gender = RelLib.Person.MALE - elif other.get_gender() == RelLib.Person.FEMALE: - gender = RelLib.Person.FEMALE + if other.get_gender() == gen.lib.Person.MALE: + gender = gen.lib.Person.MALE + elif other.get_gender() == gen.lib.Person.FEMALE: + gender = gen.lib.Person.FEMALE # Person's gender is unknown, try guessing from spouse's - elif orig.get_gender() == RelLib.Person.MALE: - if family_rel == RelLib.FamilyRelType.CIVIL_UNION: - gender = RelLib.Person.MALE + elif orig.get_gender() == gen.lib.Person.MALE: + if family_rel == gen.lib.FamilyRelType.CIVIL_UNION: + gender = gen.lib.Person.MALE else: - gender = RelLib.Person.FEMALE - elif orig.get_gender() == RelLib.Person.FEMALE: - if family_rel == RelLib.FamilyRelType.CIVIL_UNION: - gender = RelLib.Person.FEMALE + gender = gen.lib.Person.FEMALE + elif orig.get_gender() == gen.lib.Person.FEMALE: + if family_rel == gen.lib.FamilyRelType.CIVIL_UNION: + gender = gen.lib.Person.FEMALE else: - gender = RelLib.Person.MALE + gender = gen.lib.Person.MALE else: - gender = RelLib.Person.UNKNOWN + gender = gen.lib.Person.UNKNOWN - if family_rel == RelLib.FamilyRelType.MARRIED: - if gender == RelLib.Person.MALE: + if family_rel == gen.lib.FamilyRelType.MARRIED: + if gender == gen.lib.Person.MALE: return _("husband") - elif gender == RelLib.Person.FEMALE: + elif gender == gen.lib.Person.FEMALE: return _("wife") else: return _("gender unknown|spouse") - elif family_rel == RelLib.FamilyRelType.UNMARRIED: - if gender == RelLib.Person.MALE: + elif family_rel == gen.lib.FamilyRelType.UNMARRIED: + if gender == gen.lib.Person.MALE: return _("unmarried|husband") - elif gender == RelLib.Person.FEMALE: + elif gender == gen.lib.Person.FEMALE: return _("unmarried|wife") else: return _("gender unknown,unmarried|spouse") - elif family_rel == RelLib.FamilyRelType.CIVIL_UNION: - if gender == RelLib.Person.MALE: + elif family_rel == gen.lib.FamilyRelType.CIVIL_UNION: + if gender == gen.lib.Person.MALE: return _("male,civil union|partner") - elif gender == RelLib.Person.FEMALE: + elif gender == gen.lib.Person.FEMALE: return _("female,civil union|partner") else: return _("gender unknown,civil union|partner") else: - if gender == RelLib.Person.MALE: + if gender == gen.lib.Person.MALE: return _("male,unknown relation|partner") - elif gender == RelLib.Person.FEMALE: + elif gender == gen.lib.Person.FEMALE: return _("female,unknown relation|partner") else: return _("gender unknown,unknown relation|partner") @@ -432,22 +432,22 @@ class RelationshipCalculator: if firstRel == 0: if secondRel == 0: return ('',common) - elif other_person.get_gender() == RelLib.Person.MALE: + elif other_person.get_gender() == gen.lib.Person.MALE: return (self.get_father(secondRel),common) else: return (self.get_mother(secondRel),common) elif secondRel == 0: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_son(firstRel),common) else: return (self.get_daughter(firstRel),common) elif firstRel == 1: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_uncle(secondRel),common) else: return (self.get_aunt(secondRel),common) elif secondRel == 1: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_nephew(firstRel-1),common) else: return (self.get_niece(firstRel-1),common) diff --git a/src/ReportBase/_ReportUtils.py b/src/ReportBase/_ReportUtils.py index a7d13e25b..7f487e62c 100644 --- a/src/ReportBase/_ReportUtils.py +++ b/src/ReportBase/_ReportUtils.py @@ -41,7 +41,7 @@ from gettext import gettext as _ # #------------------------------------------------------------------------ import DateHandler -import RelLib +import gen.lib from BasicUtils import name_displayer as _nd from QuestionDialog import WarningDialog import BaseDoc @@ -54,92 +54,92 @@ import BaseDoc born_full_date_with_place = [ { - RelLib.Person.UNKNOWN : _("This person was born on %(birth_date)s in %(birth_place)s."), - RelLib.Person.MALE : _("He was born on %(birth_date)s in %(birth_place)s."), - RelLib.Person.FEMALE : _("She was born on %(birth_date)s in %(birth_place)s."), + gen.lib.Person.UNKNOWN : _("This person was born on %(birth_date)s in %(birth_place)s."), + gen.lib.Person.MALE : _("He was born on %(birth_date)s in %(birth_place)s."), + gen.lib.Person.FEMALE : _("She was born on %(birth_date)s in %(birth_place)s."), }, { - RelLib.Person.UNKNOWN : _("%(unknown_gender_name)s was born on %(birth_date)s in %(birth_place)s."), - RelLib.Person.MALE : _("%(male_name)s was born on %(birth_date)s in %(birth_place)s."), - RelLib.Person.FEMALE : _("%(female_name)s was born on %(birth_date)s in %(birth_place)s."), + gen.lib.Person.UNKNOWN : _("%(unknown_gender_name)s was born on %(birth_date)s in %(birth_place)s."), + gen.lib.Person.MALE : _("%(male_name)s was born on %(birth_date)s in %(birth_place)s."), + gen.lib.Person.FEMALE : _("%(female_name)s was born on %(birth_date)s in %(birth_place)s."), }, ] born_modified_date_with_place = [ { - RelLib.Person.UNKNOWN : _("This person was born %(modified_date)s in %(birth_place)s."), - RelLib.Person.MALE : _("He was born %(modified_date)s in %(birth_place)s."), - RelLib.Person.FEMALE : _("She was born %(modified_date)s in %(birth_place)s."), + gen.lib.Person.UNKNOWN : _("This person was born %(modified_date)s in %(birth_place)s."), + gen.lib.Person.MALE : _("He was born %(modified_date)s in %(birth_place)s."), + gen.lib.Person.FEMALE : _("She was born %(modified_date)s in %(birth_place)s."), }, { - RelLib.Person.UNKNOWN : _("%(unknown_gender_name)s was born %(modified_date)s in %(birth_place)s."), - RelLib.Person.MALE : _("%(male_name)s was born %(modified_date)s in %(birth_place)s."), - RelLib.Person.FEMALE : _("%(female_name)s was born %(modified_date)s in %(birth_place)s."), + gen.lib.Person.UNKNOWN : _("%(unknown_gender_name)s was born %(modified_date)s in %(birth_place)s."), + gen.lib.Person.MALE : _("%(male_name)s was born %(modified_date)s in %(birth_place)s."), + gen.lib.Person.FEMALE : _("%(female_name)s was born %(modified_date)s in %(birth_place)s."), }, ] born_full_date_no_place = [ { - RelLib.Person.UNKNOWN : _("This person was born on %(birth_date)s."), - RelLib.Person.MALE : _("He was born on %(birth_date)s."), - RelLib.Person.FEMALE : _("She was born on %(birth_date)s."), + gen.lib.Person.UNKNOWN : _("This person was born on %(birth_date)s."), + gen.lib.Person.MALE : _("He was born on %(birth_date)s."), + gen.lib.Person.FEMALE : _("She was born on %(birth_date)s."), }, { - RelLib.Person.UNKNOWN : _("%(unknown_gender_name)s was born on %(birth_date)s."), - RelLib.Person.MALE : _("%(male_name)s was born on %(birth_date)s."), - RelLib.Person.FEMALE : _("%(female_name)s was born on %(birth_date)s."), + gen.lib.Person.UNKNOWN : _("%(unknown_gender_name)s was born on %(birth_date)s."), + gen.lib.Person.MALE : _("%(male_name)s was born on %(birth_date)s."), + gen.lib.Person.FEMALE : _("%(female_name)s was born on %(birth_date)s."), }, ] born_modified_date_no_place = [ { - RelLib.Person.UNKNOWN : _("This person was born %(modified_date)s."), - RelLib.Person.MALE : _("He was born %(modified_date)s."), - RelLib.Person.FEMALE : _("She was born %(modified_date)s."), + gen.lib.Person.UNKNOWN : _("This person was born %(modified_date)s."), + gen.lib.Person.MALE : _("He was born %(modified_date)s."), + gen.lib.Person.FEMALE : _("She was born %(modified_date)s."), }, { - RelLib.Person.UNKNOWN : _("%(unknown_gender_name)s was born %(modified_date)s."), - RelLib.Person.MALE : _("%(male_name)s was born %(modified_date)s."), - RelLib.Person.FEMALE : _("%(female_name)s was born %(modified_date)s."), + gen.lib.Person.UNKNOWN : _("%(unknown_gender_name)s was born %(modified_date)s."), + gen.lib.Person.MALE : _("%(male_name)s was born %(modified_date)s."), + gen.lib.Person.FEMALE : _("%(female_name)s was born %(modified_date)s."), }, ] born_partial_date_with_place = [ { - RelLib.Person.UNKNOWN : _("This person was born in %(month_year)s in %(birth_place)s."), - RelLib.Person.MALE : _("He was born in %(month_year)s in %(birth_place)s."), - RelLib.Person.FEMALE : _("She was born in %(month_year)s in %(birth_place)s."), + gen.lib.Person.UNKNOWN : _("This person was born in %(month_year)s in %(birth_place)s."), + gen.lib.Person.MALE : _("He was born in %(month_year)s in %(birth_place)s."), + gen.lib.Person.FEMALE : _("She was born in %(month_year)s in %(birth_place)s."), }, { - RelLib.Person.UNKNOWN : _("%(unknown_gender_name)s was born in %(month_year)s in %(birth_place)s."), - RelLib.Person.MALE : _("%(male_name)s was born in %(month_year)s in %(birth_place)s."), - RelLib.Person.FEMALE : _("%(female_name)s was born in %(month_year)s in %(birth_place)s."), + gen.lib.Person.UNKNOWN : _("%(unknown_gender_name)s was born in %(month_year)s in %(birth_place)s."), + gen.lib.Person.MALE : _("%(male_name)s was born in %(month_year)s in %(birth_place)s."), + gen.lib.Person.FEMALE : _("%(female_name)s was born in %(month_year)s in %(birth_place)s."), }, ] born_partial_date_no_place = [ { - RelLib.Person.UNKNOWN : _("This person was born in %(month_year)s."), - RelLib.Person.MALE : _("He was born in %(month_year)s."), - RelLib.Person.FEMALE : _("She was born in %(month_year)s."), + gen.lib.Person.UNKNOWN : _("This person was born in %(month_year)s."), + gen.lib.Person.MALE : _("He was born in %(month_year)s."), + gen.lib.Person.FEMALE : _("She was born in %(month_year)s."), }, { - RelLib.Person.UNKNOWN : _("%(unknown_gender_name)s was born in %(month_year)s."), - RelLib.Person.MALE : _("%(male_name)s was born in %(month_year)s."), - RelLib.Person.FEMALE : _("%(female_name)s was born in %(month_year)s."), + gen.lib.Person.UNKNOWN : _("%(unknown_gender_name)s was born in %(month_year)s."), + gen.lib.Person.MALE : _("%(male_name)s was born in %(month_year)s."), + gen.lib.Person.FEMALE : _("%(female_name)s was born in %(month_year)s."), } ] born_no_date_with_place = [ { - RelLib.Person.UNKNOWN : _("This person was born in %(birth_place)s."), - RelLib.Person.MALE : _("He was born in %(birth_place)s."), - RelLib.Person.FEMALE : _("She was born in %(birth_place)s."), + gen.lib.Person.UNKNOWN : _("This person was born in %(birth_place)s."), + gen.lib.Person.MALE : _("He was born in %(birth_place)s."), + gen.lib.Person.FEMALE : _("She was born in %(birth_place)s."), }, { - RelLib.Person.UNKNOWN : _("%(unknown_gender_name)s was born in %(birth_place)s."), - RelLib.Person.MALE : _("%(male_name)s was born in %(birth_place)s."), - RelLib.Person.FEMALE : _("%(female_name)s was born in %(birth_place)s."), + gen.lib.Person.UNKNOWN : _("%(unknown_gender_name)s was born in %(birth_place)s."), + gen.lib.Person.MALE : _("%(male_name)s was born in %(birth_place)s."), + gen.lib.Person.FEMALE : _("%(female_name)s was born in %(birth_place)s."), } ] @@ -150,38 +150,38 @@ born_no_date_with_place = [ #------------------------------------------------------------------------ died_full_date_with_place = [ - { RelLib.Person.UNKNOWN : [ + { gen.lib.Person.UNKNOWN : [ _("This person died on %(death_date)s in %(death_place)s."), _("This person died on %(death_date)s in %(death_place)s at the age of %(age)d years."), _("This person died on %(death_date)s in %(death_place)s at the age of %(age)d months."), _("This person died on %(death_date)s in %(death_place)s at the age of %(age)d days."), ], - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ _("He died on %(death_date)s in %(death_place)s."), _("He died on %(death_date)s in %(death_place)s at the age of %(age)d years."), _("He died on %(death_date)s in %(death_place)s at the age of %(age)d months."), _("He died on %(death_date)s in %(death_place)s at the age of %(age)d days."), ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ _("She died on %(death_date)s in %(death_place)s."), _("She died on %(death_date)s in %(death_place)s at the age of %(age)d years."), _("She died on %(death_date)s in %(death_place)s at the age of %(age)d months."), _("She died on %(death_date)s in %(death_place)s at the age of %(age)d days."), ], }, - { RelLib.Person.UNKNOWN : [ + { gen.lib.Person.UNKNOWN : [ _("%(unknown_gender_name)s died on %(death_date)s in %(death_place)s."), _("%(unknown_gender_name)s died on %(death_date)s in %(death_place)s at the age of %(age)d years."), _("%(unknown_gender_name)s died on %(death_date)s in %(death_place)s at the age of %(age)d months."), _("%(unknown_gender_name)s died on %(death_date)s in %(death_place)s at the age of %(age)d days."), ], - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ _("%(male_name)s died on %(death_date)s in %(death_place)s."), _("%(male_name)s died on %(death_date)s in %(death_place)s at the age of %(age)d years."), _("%(male_name)s died on %(death_date)s in %(death_place)s at the age of %(age)d months."), _("%(male_name)s died on %(death_date)s in %(death_place)s at the age of %(age)d days."), ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ _("%(female_name)s died on %(death_date)s in %(death_place)s."), _("%(female_name)s died on %(death_date)s in %(death_place)s at the age of %(age)d years."), _("%(female_name)s died on %(death_date)s in %(death_place)s at the age of %(age)d months."), @@ -191,38 +191,38 @@ died_full_date_with_place = [ ] died_modified_date_with_place = [ - { RelLib.Person.UNKNOWN : [ + { gen.lib.Person.UNKNOWN : [ _("This person died %(death_date)s in %(death_place)s."), _("This person died %(death_date)s in %(death_place)s at the age of %(age)d years."), _("This person died %(death_date)s in %(death_place)s at the age of %(age)d months."), _("This person died %(death_date)s in %(death_place)s at the age of %(age)d days."), ], - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ _("He died %(death_date)s in %(death_place)s."), _("He died %(death_date)s in %(death_place)s at the age of %(age)d years."), _("He died %(death_date)s in %(death_place)s at the age of %(age)d months."), _("He died %(death_date)s in %(death_place)s at the age of %(age)d days."), ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ _("She died %(death_date)s in %(death_place)s."), _("She died %(death_date)s in %(death_place)s at the age of %(age)d years."), _("She died %(death_date)s in %(death_place)s at the age of %(age)d months."), _("She died %(death_date)s in %(death_place)s at the age of %(age)d days."), ], }, - { RelLib.Person.UNKNOWN : [ + { gen.lib.Person.UNKNOWN : [ _("%(unknown_gender_name)s died %(death_date)s in %(death_place)s."), _("%(unknown_gender_name)s died %(death_date)s in %(death_place)s at the age of %(age)d years."), _("%(unknown_gender_name)s died %(death_date)s in %(death_place)s at the age of %(age)d months."), _("%(unknown_gender_name)s died %(death_date)s in %(death_place)s at the age of %(age)d days."), ], - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ _("%(male_name)s died %(death_date)s in %(death_place)s."), _("%(male_name)s died %(death_date)s in %(death_place)s at the age of %(age)d years."), _("%(male_name)s died %(death_date)s in %(death_place)s at the age of %(age)d months."), _("%(male_name)s died %(death_date)s in %(death_place)s at the age of %(age)d days."), ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ _("%(female_name)s died %(death_date)s in %(death_place)s."), _("%(female_name)s died %(death_date)s in %(death_place)s at the age of %(age)d years."), _("%(female_name)s died %(death_date)s in %(death_place)s at the age of %(age)d months."), @@ -232,38 +232,38 @@ died_modified_date_with_place = [ ] died_full_date_no_place = [ - { RelLib.Person.UNKNOWN : [ + { gen.lib.Person.UNKNOWN : [ _("This person died on %(death_date)s."), _("This person died on %(death_date)s at the age of %(age)d years."), _("This person died on %(death_date)s at the age of %(age)d months."), _("This person died on %(death_date)s at the age of %(age)d days."), ], - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ _("He died on %(death_date)s."), _("He died on %(death_date)s at the age of %(age)d years."), _("He died on %(death_date)s at the age of %(age)d months."), _("He died on %(death_date)s at the age of %(age)d days."), ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ _("She died on %(death_date)s."), _("She died on %(death_date)s at the age of %(age)d years."), _("She died on %(death_date)s at the age of %(age)d months."), _("She died on %(death_date)s at the age of %(age)d days."), ], }, - { RelLib.Person.UNKNOWN : [ + { gen.lib.Person.UNKNOWN : [ _("%(unknown_gender_name)s died on %(death_date)s."), _("%(unknown_gender_name)s died on %(death_date)s at the age of %(age)d years."), _("%(unknown_gender_name)s died on %(death_date)s at the age of %(age)d months."), _("%(unknown_gender_name)s died on %(death_date)s at the age of %(age)d days."), ], - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ _("%(male_name)s died on %(death_date)s."), _("%(male_name)s died on %(death_date)s at the age of %(age)d years."), _("%(male_name)s died on %(death_date)s at the age of %(age)d months."), _("%(male_name)s died on %(death_date)s at the age of %(age)d days."), ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ _("%(female_name)s died on %(death_date)s."), _("%(female_name)s died on %(death_date)s at the age of %(age)d years."), _("%(female_name)s died on %(death_date)s at the age of %(age)d months."), @@ -273,38 +273,38 @@ died_full_date_no_place = [ ] died_modified_date_no_place = [ - { RelLib.Person.UNKNOWN : [ + { gen.lib.Person.UNKNOWN : [ _("This person died %(death_date)s."), _("This person died %(death_date)s at the age of %(age)d years."), _("This person died %(death_date)s at the age of %(age)d months."), _("This person died %(death_date)s at the age of %(age)d days."), ], - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ _("He died %(death_date)s."), _("He died %(death_date)s at the age of %(age)d years."), _("He died %(death_date)s at the age of %(age)d months."), _("He died %(death_date)s at the age of %(age)d days."), ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ _("She died %(death_date)s."), _("She died %(death_date)s at the age of %(age)d years."), _("She died %(death_date)s at the age of %(age)d months."), _("She died %(death_date)s at the age of %(age)d days."), ], }, - { RelLib.Person.UNKNOWN : [ + { gen.lib.Person.UNKNOWN : [ _("%(unknown_gender_name)s died %(death_date)s."), _("%(unknown_gender_name)s died %(death_date)s at the age of %(age)d years."), _("%(unknown_gender_name)s died %(death_date)s at the age of %(age)d months."), _("%(unknown_gender_name)s died %(death_date)s at the age of %(age)d days."), ], - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ _("%(male_name)s died %(death_date)s."), _("%(male_name)s died %(death_date)s at the age of %(age)d years."), _("%(male_name)s died %(death_date)s at the age of %(age)d months."), _("%(male_name)s died %(death_date)s at the age of %(age)d days."), ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ _("%(female_name)s died %(death_date)s."), _("%(female_name)s died %(death_date)s at the age of %(age)d years."), _("%(female_name)s died %(death_date)s at the age of %(age)d months."), @@ -314,38 +314,38 @@ died_modified_date_no_place = [ ] died_partial_date_with_place = [ - { RelLib.Person.UNKNOWN : [ + { gen.lib.Person.UNKNOWN : [ _("This person died in %(month_year)s in %(death_place)s."), _("This person died in %(month_year)s in %(death_place)s at the age of %(age)d years."), _("This person died in %(month_year)s in %(death_place)s at the age of %(age)d months."), _("This person died in %(month_year)s in %(death_place)s at the age of %(age)d days."), ], - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ _("He died in %(month_year)s in %(death_place)s."), _("He died in %(month_year)s in %(death_place)s at the age of %(age)d years."), _("He died in %(month_year)s in %(death_place)s at the age of %(age)d months."), _("He died in %(month_year)s in %(death_place)s at the age of %(age)d days."), ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ _("She died in %(month_year)s in %(death_place)s."), _("She died in %(month_year)s in %(death_place)s at the age of %(age)d years."), _("She died in %(month_year)s in %(death_place)s at the age of %(age)d months."), _("She died in %(month_year)s in %(death_place)s at the age of %(age)d days."), ] }, - { RelLib.Person.UNKNOWN : [ + { gen.lib.Person.UNKNOWN : [ _("%(unknown_gender_name)s died in %(month_year)s in %(death_place)s."), _("%(unknown_gender_name)s died in %(month_year)s in %(death_place)s at the age of %(age)d years."), _("%(unknown_gender_name)s died in %(month_year)s in %(death_place)s at the age of %(age)d months."), _("%(unknown_gender_name)s died in %(month_year)s in %(death_place)s at the age of %(age)d days."), ], - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ _("%(male_name)s died in %(month_year)s in %(death_place)s."), _("%(male_name)s died in %(month_year)s in %(death_place)s at the age of %(age)d years."), _("%(male_name)s died in %(month_year)s in %(death_place)s at the age of %(age)d months."), _("%(male_name)s died in %(month_year)s in %(death_place)s at the age of %(age)d days."), ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ _("%(female_name)s died in %(month_year)s in %(death_place)s."), _("%(female_name)s died in %(month_year)s in %(death_place)s at the age of %(age)d years."), _("%(female_name)s died in %(month_year)s in %(death_place)s at the age of %(age)d months."), @@ -355,38 +355,38 @@ died_partial_date_with_place = [ ] died_partial_date_no_place = [ - { RelLib.Person.UNKNOWN : [ + { gen.lib.Person.UNKNOWN : [ _("This person died in %(month_year)s."), _("This person died in %(month_year)s at the age of %(age)d years."), _("This person died in %(month_year)s at the age of %(age)d months."), _("This person died in %(month_year)s at the age of %(age)d days."), ], - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ _("He died in %(month_year)s."), _("He died in %(month_year)s at the age of %(age)d years."), _("He died in %(month_year)s at the age of %(age)d months."), _("He died in %(month_year)s at the age of %(age)d days."), ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ _("She died in %(month_year)s."), _("She died in %(month_year)s at the age of %(age)d years."), _("She died in %(month_year)s at the age of %(age)d months."), _("She died in %(month_year)s at the age of %(age)d days."), ], }, - { RelLib.Person.UNKNOWN : [ + { gen.lib.Person.UNKNOWN : [ _("%(unknown_gender_name)s died in %(month_year)s."), _("%(unknown_gender_name)s died in %(month_year)s at the age of %(age)d years."), _("%(unknown_gender_name)s died in %(month_year)s at the age of %(age)d months."), _("%(unknown_gender_name)s died in %(month_year)s at the age of %(age)d days."), ], - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ _("%(male_name)s died in %(month_year)s."), _("%(male_name)s died in %(month_year)s at the age of %(age)d years."), _("%(male_name)s died in %(month_year)s at the age of %(age)d months."), _("%(male_name)s died in %(month_year)s at the age of %(age)d days."), ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ _("%(female_name)s died in %(month_year)s."), _("%(female_name)s died in %(month_year)s at the age of %(age)d years."), _("%(female_name)s died in %(month_year)s at the age of %(age)d months."), @@ -397,38 +397,38 @@ died_partial_date_no_place = [ died_no_date_with_place = [ { - RelLib.Person.UNKNOWN : [ + gen.lib.Person.UNKNOWN : [ _("This person died in %(death_place)s."), _("This person died in %(death_place)s at the age of %(age)d years."), _("This person died in %(death_place)s at the age of %(age)d months."), _("This person died in %(death_place)s at the age of %(age)d days."), ], - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ _("He died in %(death_place)s."), _("He died in %(death_place)s at the age of %(age)d years."), _("He died in %(death_place)s at the age of %(age)d months."), _("He died in %(death_place)s at the age of %(age)d days."), ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ _("She died in %(death_place)s."), _("She died in %(death_place)s at the age of %(age)d years."), _("She died in %(death_place)s at the age of %(age)d months."), _("She died in %(death_place)s at the age of %(age)d days."), ], }, - { RelLib.Person.UNKNOWN : [ + { gen.lib.Person.UNKNOWN : [ _("%(unknown_gender_name)s died in %(death_place)s."), _("%(unknown_gender_name)s died in %(death_place)s at the age of %(age)d years."), _("%(unknown_gender_name)s died in %(death_place)s at the age of %(age)d months."), _("%(unknown_gender_name)s died in %(death_place)s at the age of %(age)d days."), ], - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ _("%(male_name)s died in %(death_place)s."), _("%(male_name)s died in %(death_place)s at the age of %(age)d years."), _("%(male_name)s died in %(death_place)s at the age of %(age)d months."), _("%(male_name)s died in %(death_place)s at the age of %(age)d days."), ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ _("%(female_name)s died in %(death_place)s."), _("%(female_name)s died in %(death_place)s at the age of %(age)d years."), _("%(female_name)s died in %(death_place)s at the age of %(age)d months."), @@ -438,38 +438,38 @@ died_no_date_with_place = [ ] died_no_date_no_place = [ - { RelLib.Person.UNKNOWN : [ + { gen.lib.Person.UNKNOWN : [ "", _("This person died at the age of %(age)d years."), _("This person died at the age of %(age)d months."), _("This person died at the age of %(age)d days."), ], - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ "", _("He died at the age of %(age)d years."), _("He died at the age of %(age)d months."), _("He died at the age of %(age)d days."), ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ "", _("She died at the age of %(age)d years."), _("She died at the age of %(age)d months."), _("She died at the age of %(age)d days."), ], }, - { RelLib.Person.UNKNOWN : [ + { gen.lib.Person.UNKNOWN : [ "", _("%(unknown_gender_name)s died at the age of %(age)d years."), _("%(unknown_gender_name)s died at the age of %(age)d months."), _("%(unknown_gender_name)s died at the age of %(age)d days."), ], - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ "", _("%(male_name)s died at the age of %(age)d years."), _("%(male_name)s died at the age of %(age)d months."), _("%(male_name)s died at the age of %(age)d days."), ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ "", _("%(female_name)s died at the age of %(age)d years."), _("%(female_name)s died at the age of %(age)d months."), @@ -485,120 +485,120 @@ died_no_date_no_place = [ #------------------------------------------------------------------------ buried_full_date_place = { - RelLib.Person.MALE: [ + gen.lib.Person.MALE: [ _("%(male_name)s was buried on %(burial_date)s in %(burial_place)s."), _("He was buried on %(burial_date)s in %(burial_place)s."), ], - RelLib.Person.FEMALE: [ + gen.lib.Person.FEMALE: [ _("%(female_name)s was buried on %(burial_date)s in %(burial_place)s."), _("She was buried on %(burial_date)s in %(burial_place)s."), ], - RelLib.Person.UNKNOWN: [ + gen.lib.Person.UNKNOWN: [ _("%(unknown_gender_name)s was buried on %(burial_date)s in %(burial_place)s."), _("This person was buried on %(burial_date)s in %(burial_place)s."), ], } buried_full_date_no_place = { - RelLib.Person.MALE: [ + gen.lib.Person.MALE: [ _("%(male_name)s was buried on %(burial_date)s."), _("He was buried on %(burial_date)s."), ], - RelLib.Person.FEMALE: [ + gen.lib.Person.FEMALE: [ _("%(female_name)s was buried on %(burial_date)s."), _("She was buried on %(burial_date)s."), ], - RelLib.Person.UNKNOWN: [ + gen.lib.Person.UNKNOWN: [ _("%(unknown_gender_name)s was buried on %(burial_date)s."), _("This person was buried on %(burial_date)s."), ], } buried_partial_date_place = { - RelLib.Person.MALE: [ + gen.lib.Person.MALE: [ _("%(male_name)s was buried in %(month_year)s in %(burial_place)s."), _("He was buried in %(month_year)s in %(burial_place)s."), ], - RelLib.Person.FEMALE: [ + gen.lib.Person.FEMALE: [ _("%(female_name)s was buried in %(month_year)s in %(burial_place)s."), _("She was buried in %(month_year)s in %(burial_place)s."), ], - RelLib.Person.UNKNOWN: [ + gen.lib.Person.UNKNOWN: [ _("%(unknown_gender_name)s was buried in %(month_year)s in %(burial_place)s."), _("This person was buried in %(month_year)s in %(burial_place)s."), ], } buried_partial_date_no_place = { - RelLib.Person.MALE: [ + gen.lib.Person.MALE: [ _("%(male_name)s was buried in %(month_year)s."), _("He was buried in %(month_year)s."), ], - RelLib.Person.FEMALE: [ + gen.lib.Person.FEMALE: [ _("%(female_name)s was buried in %(month_year)s."), _("She was buried in %(month_year)s."), ], - RelLib.Person.UNKNOWN: [ + gen.lib.Person.UNKNOWN: [ _("%(unknown_gender_name)s was buried in %(month_year)s."), _("This person was buried in %(month_year)s."), ], } buried_modified_date_place = { - RelLib.Person.MALE: [ + gen.lib.Person.MALE: [ _("%(male_name)s was buried %(modified_date)s in %(burial_place)s."), _("He was buried %(modified_date)s in %(burial_place)s."), ], - RelLib.Person.FEMALE: [ + gen.lib.Person.FEMALE: [ _("%(female_name)s was buried %(modified_date)s in %(burial_place)s."), _("She was buried %(modified_date)s in %(burial_place)s."), ], - RelLib.Person.UNKNOWN: [ + gen.lib.Person.UNKNOWN: [ _("%(unknown_gender_name)s was buried %(modified_date)s in %(burial_place)s."), _("This person was buried %(modified_date)s in %(burial_place)s."), ], } buried_modified_date_no_place = { - RelLib.Person.MALE: [ + gen.lib.Person.MALE: [ _("%(male_name)s was buried %(modified_date)s."), _("He was buried %(modified_date)s."), ], - RelLib.Person.FEMALE: [ + gen.lib.Person.FEMALE: [ _("%(female_name)s was buried %(modified_date)s."), _("She was buried %(modified_date)s."), ], - RelLib.Person.UNKNOWN: [ + gen.lib.Person.UNKNOWN: [ _("%(unknown_gender_name)s was buried %(modified_date)s."), _("This person was buried %(modified_date)s."), ], } buried_no_date_place = { - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ _("%(male_name)s was buried in %(burial_place)s."), _("He was buried in %(burial_place)s."), ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ _("%(female_name)s was buried in %(burial_place)s."), _("She was buried in %(burial_place)s."), ], - RelLib.Person.UNKNOWN : [ + gen.lib.Person.UNKNOWN : [ _("%(unknown_gender_name)s was buried in %(burial_place)s."), _("This person was buried in %(burial_place)s."), ], } buried_no_date_no_place = { - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ _("%(male_name)s was buried."), _("He was buried."), ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ _("%(female_name)s was buried."), _("She was buried."), ], - RelLib.Person.UNKNOWN : [ + gen.lib.Person.UNKNOWN : [ _("%(unknown_gender_name)s was buried."), _("This person was buried."), ] @@ -611,17 +611,17 @@ buried_no_date_no_place = { #------------------------------------------------------------------------ marriage_first_date_place = { - RelLib.Person.UNKNOWN : [ + gen.lib.Person.UNKNOWN : [ _('This person married %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('This person married %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('This person married %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), ], - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ _('He married %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('He married %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('He married %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ _('She married %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('She married %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('She married %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), @@ -629,17 +629,17 @@ marriage_first_date_place = { } marriage_also_date_place = { - RelLib.Person.UNKNOWN : [ + gen.lib.Person.UNKNOWN : [ _('This person also married %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('This person also married %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('This person also married %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), ], - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ _('He also married %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('He also married %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('He also married %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ _('She also married %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('She also married %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('She also married %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), @@ -647,17 +647,17 @@ marriage_also_date_place = { } marriage_first_date = { - RelLib.Person.UNKNOWN : [ + gen.lib.Person.UNKNOWN : [ _('This person married %(spouse)s in %(partial_date)s%(endnotes)s.'), _('This person married %(spouse)s on %(full_date)s%(endnotes)s.'), _('This person married %(spouse)s %(modified_date)s%(endnotes)s.'), ], - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ _('He married %(spouse)s in %(partial_date)s%(endnotes)s.'), _('He married %(spouse)s on %(full_date)s%(endnotes)s.'), _('He married %(spouse)s %(modified_date)s%(endnotes)s.'), ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ _('She married %(spouse)s in %(partial_date)s%(endnotes)s.'), _('She married %(spouse)s on %(full_date)s%(endnotes)s.'), _('She married %(spouse)s %(modified_date)s%(endnotes)s.'), @@ -665,17 +665,17 @@ marriage_first_date = { } marriage_also_date = { - RelLib.Person.UNKNOWN : [ + gen.lib.Person.UNKNOWN : [ _('This person also married %(spouse)s in %(partial_date)s%(endnotes)s.'), _('This person also married %(spouse)s on %(full_date)s%(endnotes)s.'), _('This person also married %(spouse)s %(modified_date)s%(endnotes)s.'), ], - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ _('He also married %(spouse)s in %(partial_date)s%(endnotes)s.'), _('He also married %(spouse)s on %(full_date)s%(endnotes)s.'), _('He also married %(spouse)s %(modified_date)s%(endnotes)s.'), ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ _('She also married %(spouse)s in %(partial_date)s%(endnotes)s.'), _('She also married %(spouse)s on %(full_date)s%(endnotes)s.'), _('She also married %(spouse)s %(modified_date)s%(endnotes)s.'), @@ -683,27 +683,27 @@ marriage_also_date = { } marriage_first_place = { - RelLib.Person.UNKNOWN : _('This person married %(spouse)s in %(place)s%(endnotes)s.'), - RelLib.Person.MALE : _('He married %(spouse)s in %(place)s%(endnotes)s.'), - RelLib.Person.FEMALE : _('She married %(spouse)s in %(place)s%(endnotes)s.'), + gen.lib.Person.UNKNOWN : _('This person married %(spouse)s in %(place)s%(endnotes)s.'), + gen.lib.Person.MALE : _('He married %(spouse)s in %(place)s%(endnotes)s.'), + gen.lib.Person.FEMALE : _('She married %(spouse)s in %(place)s%(endnotes)s.'), } marriage_also_place = { - RelLib.Person.UNKNOWN : _('This person also married %(spouse)s in %(place)s%(endnotes)s.'), - RelLib.Person.MALE : _('He also married %(spouse)s in %(place)s%(endnotes)s.'), - RelLib.Person.FEMALE : _('She also married %(spouse)s in %(place)s%(endnotes)s.'), + gen.lib.Person.UNKNOWN : _('This person also married %(spouse)s in %(place)s%(endnotes)s.'), + gen.lib.Person.MALE : _('He also married %(spouse)s in %(place)s%(endnotes)s.'), + gen.lib.Person.FEMALE : _('She also married %(spouse)s in %(place)s%(endnotes)s.'), } marriage_first_only = { - RelLib.Person.UNKNOWN : _('This person married %(spouse)s%(endnotes)s.'), - RelLib.Person.MALE : _('He married %(spouse)s%(endnotes)s.'), - RelLib.Person.FEMALE : _('She married %(spouse)s%(endnotes)s.'), + gen.lib.Person.UNKNOWN : _('This person married %(spouse)s%(endnotes)s.'), + gen.lib.Person.MALE : _('He married %(spouse)s%(endnotes)s.'), + gen.lib.Person.FEMALE : _('She married %(spouse)s%(endnotes)s.'), } marriage_also_only = { - RelLib.Person.UNKNOWN : _('This person also married %(spouse)s%(endnotes)s.'), - RelLib.Person.MALE : _('He also married %(spouse)s%(endnotes)s.'), - RelLib.Person.FEMALE : _('She also married %(spouse)s%(endnotes)s.'), + gen.lib.Person.UNKNOWN : _('This person also married %(spouse)s%(endnotes)s.'), + gen.lib.Person.MALE : _('He also married %(spouse)s%(endnotes)s.'), + gen.lib.Person.FEMALE : _('She also married %(spouse)s%(endnotes)s.'), } #------------------------------------------------------------------------ @@ -713,17 +713,17 @@ marriage_also_only = { #------------------------------------------------------------------------ unmarried_first_date_place = { - RelLib.Person.UNKNOWN : [ + gen.lib.Person.UNKNOWN : [ _('This person had an unmarried relationship with %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('This person had an unmarried relationship with %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('This person had an unmarried relationship with %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), ], - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ _('He had an unmarried relationship with %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('He had an unmarried relationship with %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('He had an unmarried relationship with %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ _('She had an unmarried relationship with %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('She had an unmarried relationship with %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('She had an unmarried relationship with %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), @@ -731,17 +731,17 @@ unmarried_first_date_place = { } unmarried_also_date_place = { - RelLib.Person.UNKNOWN : [ + gen.lib.Person.UNKNOWN : [ _('This person also had an unmarried relationship with %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('This person also had an unmarried relationship with %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('This person also had an unmarried relationship with %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), ], - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ _('He also had an unmarried relationship with %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('He also had an unmarried relationship with %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('He also had an unmarried relationship with %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ _('She also had an unmarried relationship with %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('She also had an unmarried relationship with %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('She also had an unmarried relationship with %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), @@ -749,17 +749,17 @@ unmarried_also_date_place = { } unmarried_first_date = { - RelLib.Person.UNKNOWN : [ + gen.lib.Person.UNKNOWN : [ _('This person had an unmarried relationship with %(spouse)s in %(partial_date)s%(endnotes)s.'), _('This person had an unmarried relationship with %(spouse)s on %(full_date)s%(endnotes)s.'), _('This person had an unmarried relationship with %(spouse)s %(modified_date)s%(endnotes)s.'), ], - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ _('He had an unmarried relationship with %(spouse)s in %(partial_date)s%(endnotes)s.'), _('He had an unmarried relationship with %(spouse)s on %(full_date)s%(endnotes)s.'), _('He had an unmarried relationship with %(spouse)s %(modified_date)s%(endnotes)s.'), ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ _('She had an unmarried relationship with %(spouse)s in %(partial_date)s%(endnotes)s.'), _('She had an unmarried relationship with %(spouse)s on %(full_date)s%(endnotes)s.'), _('She had an unmarried relationship with %(spouse)s %(modified_date)s%(endnotes)s.'), @@ -767,17 +767,17 @@ unmarried_first_date = { } unmarried_also_date = { - RelLib.Person.UNKNOWN : [ + gen.lib.Person.UNKNOWN : [ _('This person also had an unmarried relationship with %(spouse)s in %(partial_date)s%(endnotes)s.'), _('This person also had an unmarried relationship with %(spouse)s on %(full_date)s%(endnotes)s.'), _('This person also had an unmarried relationship with %(spouse)s %(modified_date)s%(endnotes)s.'), ], - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ _('He also had an unmarried relationship with %(spouse)s in %(partial_date)s%(endnotes)s.'), _('He also had an unmarried relationship with %(spouse)s on %(full_date)s%(endnotes)s.'), _('He also had an unmarried relationship with %(spouse)s %(modified_date)s%(endnotes)s.'), ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ _('She also had an unmarried relationship with %(spouse)s in %(partial_date)s%(endnotes)s.'), _('She also had an unmarried relationship with %(spouse)s on %(full_date)s%(endnotes)s.'), _('She also had an unmarried relationship with %(spouse)s %(modified_date)s%(endnotes)s.'), @@ -785,27 +785,27 @@ unmarried_also_date = { } unmarried_first_place = { - RelLib.Person.UNKNOWN : _('This person had an unmarried relationship with %(spouse)s in %(place)s%(endnotes)s.'), - RelLib.Person.MALE : _('He had an unmarried relationship with %(spouse)s in %(place)s%(endnotes)s.'), - RelLib.Person.FEMALE : _('She had an unmarried relationship with %(spouse)s in %(place)s%(endnotes)s.'), + gen.lib.Person.UNKNOWN : _('This person had an unmarried relationship with %(spouse)s in %(place)s%(endnotes)s.'), + gen.lib.Person.MALE : _('He had an unmarried relationship with %(spouse)s in %(place)s%(endnotes)s.'), + gen.lib.Person.FEMALE : _('She had an unmarried relationship with %(spouse)s in %(place)s%(endnotes)s.'), } unmarried_also_place = { - RelLib.Person.UNKNOWN : _('This person also had an unmarried relationship with %(spouse)s in %(place)s%(endnotes)s.'), - RelLib.Person.MALE : _('He also had an unmarried relationship with %(spouse)s in %(place)s%(endnotes)s.'), - RelLib.Person.FEMALE : _('She also had an unmarried relationship with %(spouse)s in %(place)s%(endnotes)s.'), + gen.lib.Person.UNKNOWN : _('This person also had an unmarried relationship with %(spouse)s in %(place)s%(endnotes)s.'), + gen.lib.Person.MALE : _('He also had an unmarried relationship with %(spouse)s in %(place)s%(endnotes)s.'), + gen.lib.Person.FEMALE : _('She also had an unmarried relationship with %(spouse)s in %(place)s%(endnotes)s.'), } unmarried_first_only = { - RelLib.Person.UNKNOWN : _('This person had an unmarried relationship with %(spouse)s%(endnotes)s.'), - RelLib.Person.MALE : _('He had an unmarried relationship with %(spouse)s%(endnotes)s.'), - RelLib.Person.FEMALE : _('She had an unmarried relationship with %(spouse)s%(endnotes)s.'), + gen.lib.Person.UNKNOWN : _('This person had an unmarried relationship with %(spouse)s%(endnotes)s.'), + gen.lib.Person.MALE : _('He had an unmarried relationship with %(spouse)s%(endnotes)s.'), + gen.lib.Person.FEMALE : _('She had an unmarried relationship with %(spouse)s%(endnotes)s.'), } unmarried_also_only = { - RelLib.Person.UNKNOWN : _('This person also had an unmarried relationship with %(spouse)s%(endnotes)s.'), - RelLib.Person.MALE : _('He also had an unmarried relationship with %(spouse)s%(endnotes)s.'), - RelLib.Person.FEMALE : _('She also had an unmarried relationship with %(spouse)s%(endnotes)s.'), + gen.lib.Person.UNKNOWN : _('This person also had an unmarried relationship with %(spouse)s%(endnotes)s.'), + gen.lib.Person.MALE : _('He also had an unmarried relationship with %(spouse)s%(endnotes)s.'), + gen.lib.Person.FEMALE : _('She also had an unmarried relationship with %(spouse)s%(endnotes)s.'), } #------------------------------------------------------------------------ @@ -816,17 +816,17 @@ unmarried_also_only = { #------------------------------------------------------------------------ relationship_first_date_place = { - RelLib.Person.UNKNOWN : [ + gen.lib.Person.UNKNOWN : [ _('This person had a relationship with %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('This person had a relationship with %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('This person had a relationship with %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), ], - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ _('He had a relationship with %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('He had a relationship with %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('He had a relationship with %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ _('She had a relationship with %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('She had a relationship with %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('She had a relationship with %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), @@ -834,17 +834,17 @@ relationship_first_date_place = { } relationship_also_date_place = { - RelLib.Person.UNKNOWN : [ + gen.lib.Person.UNKNOWN : [ _('This person also had a relationship with %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('This person also had a relationship with %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('This person also had a relationship with %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), ], - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ _('He also had a relationship with %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('He also had a relationship with %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('He also had a relationship with %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ _('She also had a relationship with %(spouse)s in %(partial_date)s in %(place)s%(endnotes)s.'), _('She also had a relationship with %(spouse)s on %(full_date)s in %(place)s%(endnotes)s.'), _('She also had a relationship with %(spouse)s %(modified_date)s in %(place)s%(endnotes)s.'), @@ -852,17 +852,17 @@ relationship_also_date_place = { } relationship_first_date = { - RelLib.Person.UNKNOWN : [ + gen.lib.Person.UNKNOWN : [ _('This person had a relationship with %(spouse)s in %(partial_date)s%(endnotes)s.'), _('This person had a relationship with %(spouse)s on %(full_date)s%(endnotes)s.'), _('This person had a relationship with %(spouse)s %(modified_date)s%(endnotes)s.'), ], - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ _('He had a relationship with %(spouse)s in %(partial_date)s%(endnotes)s.'), _('He had a relationship with %(spouse)s on %(full_date)s%(endnotes)s.'), _('He had a relationship with %(spouse)s %(modified_date)s%(endnotes)s.'), ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ _('She had a relationship with %(spouse)s in %(partial_date)s%(endnotes)s.'), _('She had a relationship with %(spouse)s on %(full_date)s%(endnotes)s.'), _('She had a relationship with %(spouse)s %(modified_date)s%(endnotes)s.'), @@ -870,17 +870,17 @@ relationship_first_date = { } relationship_also_date = { - RelLib.Person.UNKNOWN : [ + gen.lib.Person.UNKNOWN : [ _('This person also had a relationship with %(spouse)s in %(partial_date)s%(endnotes)s.'), _('This person also had a relationship with %(spouse)s on %(full_date)s%(endnotes)s.'), _('This person also had a relationship with %(spouse)s %(modified_date)s%(endnotes)s.'), ], - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ _('He also had a relationship with %(spouse)s in %(partial_date)s%(endnotes)s.'), _('He also had a relationship with %(spouse)s on %(full_date)s%(endnotes)s.'), _('He also had a relationship with %(spouse)s %(modified_date)s%(endnotes)s.'), ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ _('She also had a relationship with %(spouse)s in %(partial_date)s%(endnotes)s.'), _('She also had a relationship with %(spouse)s on %(full_date)s%(endnotes)s.'), _('She also had a relationship with %(spouse)s %(modified_date)s%(endnotes)s.'), @@ -888,27 +888,27 @@ relationship_also_date = { } relationship_first_place = { - RelLib.Person.UNKNOWN : _('This person had a relationship with %(spouse)s in %(place)s%(endnotes)s.'), - RelLib.Person.MALE : _('He had a relationship with %(spouse)s in %(place)s%(endnotes)s.'), - RelLib.Person.FEMALE : _('She had a relationship with %(spouse)s in %(place)s%(endnotes)s.'), + gen.lib.Person.UNKNOWN : _('This person had a relationship with %(spouse)s in %(place)s%(endnotes)s.'), + gen.lib.Person.MALE : _('He had a relationship with %(spouse)s in %(place)s%(endnotes)s.'), + gen.lib.Person.FEMALE : _('She had a relationship with %(spouse)s in %(place)s%(endnotes)s.'), } relationship_also_place = { - RelLib.Person.UNKNOWN : _('This person also had a relationship with %(spouse)s in %(place)s%(endnotes)s.'), - RelLib.Person.MALE : _('He also had a relationship with %(spouse)s in %(place)s%(endnotes)s.'), - RelLib.Person.FEMALE : _('She also had a relationship with %(spouse)s in %(place)s%(endnotes)s.'), + gen.lib.Person.UNKNOWN : _('This person also had a relationship with %(spouse)s in %(place)s%(endnotes)s.'), + gen.lib.Person.MALE : _('He also had a relationship with %(spouse)s in %(place)s%(endnotes)s.'), + gen.lib.Person.FEMALE : _('She also had a relationship with %(spouse)s in %(place)s%(endnotes)s.'), } relationship_first_only = { - RelLib.Person.UNKNOWN : _('This person had a relationship with %(spouse)s%(endnotes)s.'), - RelLib.Person.MALE : _('He had a relationship with %(spouse)s%(endnotes)s.'), - RelLib.Person.FEMALE : _('She had a relationship with %(spouse)s%(endnotes)s.'), + gen.lib.Person.UNKNOWN : _('This person had a relationship with %(spouse)s%(endnotes)s.'), + gen.lib.Person.MALE : _('He had a relationship with %(spouse)s%(endnotes)s.'), + gen.lib.Person.FEMALE : _('She had a relationship with %(spouse)s%(endnotes)s.'), } relationship_also_only = { - RelLib.Person.UNKNOWN : _('This person also had a relationship with %(spouse)s%(endnotes)s.'), - RelLib.Person.MALE : _('He also had a relationship with %(spouse)s%(endnotes)s.'), - RelLib.Person.FEMALE : _('She also had a relationship with %(spouse)s%(endnotes)s.'), + gen.lib.Person.UNKNOWN : _('This person also had a relationship with %(spouse)s%(endnotes)s.'), + gen.lib.Person.MALE : _('He also had a relationship with %(spouse)s%(endnotes)s.'), + gen.lib.Person.FEMALE : _('She also had a relationship with %(spouse)s%(endnotes)s.'), } #------------------------------------------------------------------------- @@ -918,7 +918,7 @@ relationship_also_only = { #------------------------------------------------------------------------- child_father_mother = { - RelLib.Person.UNKNOWN: [ + gen.lib.Person.UNKNOWN: [ [ _("This person is the child of %(father)s and %(mother)s."), _("This person was the child of %(father)s and %(mother)s."), @@ -928,7 +928,7 @@ child_father_mother = { _("%(male_name)s was the child of %(father)s and %(mother)s."), ], ], - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ [ _("He is the son of %(father)s and %(mother)s."), _("He was the son of %(father)s and %(mother)s."), @@ -938,7 +938,7 @@ child_father_mother = { _("%(male_name)s was the son of %(father)s and %(mother)s."), ] ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ [ _("She is the daughter of %(father)s and %(mother)s."), _("She was the daughter of %(father)s and %(mother)s."), @@ -951,7 +951,7 @@ child_father_mother = { } child_father = { - RelLib.Person.UNKNOWN : [ + gen.lib.Person.UNKNOWN : [ [ _("This person is the child of %(father)s."), _("This person was the child of %(father)s."), @@ -961,7 +961,7 @@ child_father = { _("%(male_name)s was the child of %(father)s."), ], ], - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ [ _("He is the son of %(father)s."), _("He was the son of %(father)s."), @@ -971,7 +971,7 @@ child_father = { _("%(male_name)s was the son of %(father)s."), ], ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ [ _("She is the daughter of %(father)s."), _("She was the daughter of %(father)s."), @@ -984,7 +984,7 @@ child_father = { } child_mother = { - RelLib.Person.UNKNOWN : [ + gen.lib.Person.UNKNOWN : [ [ _("This person is the child of %(mother)s."), _("This person was the child of %(mother)s."), @@ -994,7 +994,7 @@ child_mother = { _("%(male_name)s was the child of %(mother)s."), ], ], - RelLib.Person.MALE : [ + gen.lib.Person.MALE : [ [ _("He is the son of %(mother)s."), _("He was the son of %(mother)s."), @@ -1004,7 +1004,7 @@ child_mother = { _("%(male_name)s was the son of %(mother)s."), ], ], - RelLib.Person.FEMALE : [ + gen.lib.Person.FEMALE : [ [ _("She is the daughter of %(mother)s."), _("She was the daughter of %(mother)s."), @@ -1022,10 +1022,10 @@ child_mother = { # #------------------------------------------------------------------------- _rtype = { - RelLib.FamilyRelType.UNMARRIED : _("unmarried"), - RelLib.FamilyRelType.CIVIL_UNION : _("civil union"), - RelLib.FamilyRelType.UNKNOWN : _("Unknown"), - RelLib.FamilyRelType.CUSTOM : _("Other"), + gen.lib.FamilyRelType.UNMARRIED : _("unmarried"), + gen.lib.FamilyRelType.CIVIL_UNION : _("civil union"), + gen.lib.FamilyRelType.UNKNOWN : _("Unknown"), + gen.lib.FamilyRelType.CUSTOM : _("Other"), } #------------------------------------------------------------------------- @@ -1320,14 +1320,14 @@ def estimate_age(db, person, end_handle=None, start_handle=None, today=_TODAY): else: return high[2] - low[2] - if bstop == RelLib.Date.EMPTY and dstop == RelLib.Date.EMPTY: + if bstop == gen.lib.Date.EMPTY and dstop == gen.lib.Date.EMPTY: lower = _calc_diff(bstart, dstart) age = (lower, lower) - elif bstop == RelLib.Date.EMPTY: + elif bstop == gen.lib.Date.EMPTY: lower = _calc_diff(bstart, dstart) upper = _calc_diff(bstart, dstop) age = (lower, upper) - elif dstop == RelLib.Date.EMPTY: + elif dstop == gen.lib.Date.EMPTY: lower = _calc_diff(bstop, dstart) upper = _calc_diff(bstart, dstart) age = (lower, upper) @@ -1363,14 +1363,14 @@ def estimate_age_on_date(db, person, ddata=_TODAY): return high[2] - low[2] - 1 else: return high[2] - low[2] - if bstop == RelLib.Date.EMPTY and dstop == RelLib.Date.EMPTY: + if bstop == gen.lib.Date.EMPTY and dstop == gen.lib.Date.EMPTY: lower = _calc_diff(bstart, dstart) age = [lower, lower] - elif bstop == RelLib.Date.EMPTY: + elif bstop == gen.lib.Date.EMPTY: lower = _calc_diff(bstart, dstart) upper = _calc_diff(bstart, dstop) age = [lower, upper] - elif dstop == RelLib.Date.EMPTY: + elif dstop == gen.lib.Date.EMPTY: lower = _calc_diff(bstop, dstart) upper = _calc_diff(bstart, dstart) age = [lower, upper] @@ -1467,7 +1467,7 @@ def get_birth_death_strings(database, person, empty_date="", empty_place=""): bplace = database.get_place_from_handle(bplace_handle).get_title() bdate_obj = birth.get_date_object() bdate_full = bdate_obj and bdate_obj.get_day_valid() - bdate_mod = bdate_obj and bdate_obj.get_modifier() != RelLib.Date.MOD_NONE + bdate_mod = bdate_obj and bdate_obj.get_modifier() != gen.lib.Date.MOD_NONE death_ref = person.get_death_ref() if death_ref and death_ref.ref: @@ -1479,7 +1479,7 @@ def get_birth_death_strings(database, person, empty_date="", empty_place=""): dplace = database.get_place_from_handle(dplace_handle).get_title() ddate_obj = death.get_date_object() ddate_full = ddate_obj and ddate_obj.get_day_valid() - ddate_mod = ddate_obj and ddate_obj.get_modifier() != RelLib.Date.MOD_NONE + ddate_mod = ddate_obj and ddate_obj.get_modifier() != gen.lib.Date.MOD_NONE return (bdate, bplace, bdate_full, bdate_mod, ddate, dplace, ddate_full, ddate_mod) @@ -1517,7 +1517,7 @@ def born_died_str(database, person, endnotes=None, name_object=None, person_name if person_name == None: person_name = _nd.display_name(name_object) elif person_name == 0: - if person.get_gender() == RelLib.Person.MALE: + if person.get_gender() == gen.lib.Person.MALE: person_name = _('He') else: person_name = _('She') @@ -1549,7 +1549,7 @@ def born_died_str(database, person, endnotes=None, name_object=None, person_name 'death_endnotes' : endnotes(death), } - if person.get_gender() == RelLib.Person.MALE: + if person.get_gender() == gen.lib.Person.MALE: if bdate: if bplace: if ddate: @@ -1755,7 +1755,7 @@ def married_str(database, person, family, endnotes=None, if event: dobj = event.get_date_object() - if dobj.get_modifier() != RelLib.Date.MOD_NONE: + if dobj.get_modifier() != gen.lib.Date.MOD_NONE: date_full = 2 elif dobj and dobj.get_day_valid(): date_full = 1 @@ -1778,59 +1778,59 @@ def married_str(database, person, family, endnotes=None, if is_first: if event and date and place: - if relationship == RelLib.FamilyRelType.MARRIED: + if relationship == gen.lib.FamilyRelType.MARRIED: text = marriage_first_date_place[gender][date_full] % values - elif relationship == RelLib.FamilyRelType.UNMARRIED: + elif relationship == gen.lib.FamilyRelType.UNMARRIED: text = unmarried_first_date_place[gender][date_full] % values else: text = relationship_first_date_place[gender][date_full] % values elif event and date: - if relationship == RelLib.FamilyRelType.MARRIED: + if relationship == gen.lib.FamilyRelType.MARRIED: text = marriage_first_date[gender][date_full] % values - elif relationship == RelLib.FamilyRelType.UNMARRIED: + elif relationship == gen.lib.FamilyRelType.UNMARRIED: text = unmarried_first_date[gender][date_full] % values else: text = relationship_first_date[gender][date_full] % values elif event and place: - if relationship == RelLib.FamilyRelType.MARRIED: + if relationship == gen.lib.FamilyRelType.MARRIED: text = marriage_first_place[gender] % values - elif relationship == RelLib.FamilyRelType.UNMARRIED: + elif relationship == gen.lib.FamilyRelType.UNMARRIED: text = unmarried_first_place[gender] % values else: text = relationship_first_place[gender] % values else: - if relationship == RelLib.FamilyRelType.MARRIED: + if relationship == gen.lib.FamilyRelType.MARRIED: text = marriage_first_only[gender] % values - elif relationship == RelLib.FamilyRelType.UNMARRIED: + elif relationship == gen.lib.FamilyRelType.UNMARRIED: text = unmarried_first_only[gender] % values else: text = relationship_first_only[gender] % values else: if event and date and place: - if relationship == RelLib.FamilyRelType.MARRIED: + if relationship == gen.lib.FamilyRelType.MARRIED: text = marriage_also_date_place[gender][date_full] % values - elif relationship == RelLib.FamilyRelType.UNMARRIED: + elif relationship == gen.lib.FamilyRelType.UNMARRIED: text = unmarried_also_date_place[gender][date_full] % values else: text = relationship_also_date_place[gender][date_full] % values elif event and date: - if relationship == RelLib.FamilyRelType.MARRIED: + if relationship == gen.lib.FamilyRelType.MARRIED: text = marriage_also_date[gender][date_full] % values - elif relationship == RelLib.FamilyRelType.UNMARRIED: + elif relationship == gen.lib.FamilyRelType.UNMARRIED: text = unmarried_also_date[gender][date_full] % values else: text = relationship_also_date[gender][date_full] % values elif event and place: - if relationship == RelLib.FamilyRelType.MARRIED: + if relationship == gen.lib.FamilyRelType.MARRIED: text = marriage_also_place[gender] % values - elif relationship == RelLib.FamilyRelType.UNMARRIED: + elif relationship == gen.lib.FamilyRelType.UNMARRIED: text = unmarried_also_place[gender] % values else: text = relationship_also_place[gender] % values else: - if relationship == RelLib.FamilyRelType.MARRIED: + if relationship == gen.lib.FamilyRelType.MARRIED: text = marriage_also_only[gender] % values - elif relationship == RelLib.FamilyRelType.UNMARRIED: + elif relationship == gen.lib.FamilyRelType.UNMARRIED: text = unmarried_also_only[gender] % values else: text = relationship_also_only[gender] % values @@ -1912,7 +1912,7 @@ def find_spouse(person, family): def find_marriage(database, family): for event_ref in family.get_event_ref_list(): event = database.get_event_from_handle(event_ref.ref) - if event and int(event.get_type()) == RelLib.EventType.MARRIAGE: + if event and int(event.get_type()) == gen.lib.EventType.MARRIAGE: return event return None @@ -2102,7 +2102,7 @@ def buried_str(database, person, person_name=None, empty_date="", empty_place="" burial = None for event_ref in person.get_event_ref_list(): event = database.get_event_from_handle(event_ref.ref) - if event and int(event.get_type()) == RelLib.EventType.BURIAL: + if event and int(event.get_type()) == gen.lib.EventType.BURIAL: burial = event break @@ -2113,7 +2113,7 @@ def buried_str(database, person, person_name=None, empty_date="", empty_place="" bplace = database.get_place_from_handle(bplace_handle).get_title() bdate_obj = burial.get_date_object() bdate_full = bdate_obj and bdate_obj.get_day_valid() - bdate_mod = bdate_obj and bdate_obj.get_modifier() != RelLib.Date.MOD_NONE + bdate_mod = bdate_obj and bdate_obj.get_modifier() != gen.lib.Date.MOD_NONE else: return text @@ -2236,7 +2236,7 @@ def get_birth_or_fallback(database, person): # now search the event list for fallbacks for event_ref in person.get_primary_event_ref_list(): event = database.get_event_from_handle(event_ref.ref) - if event.get_type() in [RelLib.EventType.CHRISTEN, RelLib.EventType.BAPTISM]: + if event.get_type() in [gen.lib.EventType.CHRISTEN, gen.lib.EventType.BAPTISM]: return event return None @@ -2247,7 +2247,7 @@ def get_death_or_fallback(database, person): # now search the event list for fallbacks for event_ref in person.get_primary_event_ref_list(): event = database.get_event_from_handle(event_ref.ref) - if event.get_type() in [RelLib.EventType.BURIAL, RelLib.EventType.CREMATION]: + if event.get_type() in [gen.lib.EventType.BURIAL, gen.lib.EventType.CREMATION]: return event return None @@ -2412,7 +2412,7 @@ def get_person_filters(person, include_single=True): Returns a list of filters that are relevant for the given person @param person: the person the filters should apply to. - @type person: L{RelLib.Person} + @type person: L{gen.lib.Person} @param include_single: include a filter to include the single person @type person: boolean """ diff --git a/src/ScratchPad.py b/src/ScratchPad.py index 476b8f0e1..ac29771ac 100644 --- a/src/ScratchPad.py +++ b/src/ScratchPad.py @@ -45,7 +45,7 @@ from gtk.gdk import ACTION_COPY, BUTTON1_MASK # #------------------------------------------------------------------------- import const -import RelLib +import gen.lib import TreeTips import DateHandler import GrampsDisplay @@ -460,7 +460,7 @@ class ScratchPadSourceRef(ScratchPadGrampsTypeWrapper): notelist = [ self._db.get_note_from_handle(hndl) for hndl in self._obj.get_note_list() ] srctxtlist = [ note for note in notelist - if note.get_type() == RelLib.NoteType.SOURCE_TEXT] + if note.get_type() == gen.lib.NoteType.SOURCE_TEXT] if len(srctxtlist) > 0: self._value = srctxtlist[0].get_text() diff --git a/src/Simple/_SimpleAccess.py b/src/Simple/_SimpleAccess.py index 94fc92ff6..94bcd1de9 100644 --- a/src/Simple/_SimpleAccess.py +++ b/src/Simple/_SimpleAccess.py @@ -24,13 +24,13 @@ Provides a simplified database access interface to the GRAMPS database. from types import NoneType -import RelLib +import gen.lib import DateHandler import Utils from BasicUtils import name_displayer from ReportBase import ReportUtils -from RelLib import EventType +from gen.lib import EventType class SimpleAccess: """ @@ -107,11 +107,11 @@ class SimpleAccess: Returns the name of the person, or and empty string if the person is None @param person: Person object - @type person: L{RelLib.Person} + @type person: L{gen.lib.Person} @return: Returns the name of the person based of the program preferences @rtype: unicode """ - assert(isinstance(person, (RelLib.Person, NoneType))) + assert(isinstance(person, (gen.lib.Person, NoneType))) if person: return name_displayer.display(person) else: @@ -122,11 +122,11 @@ class SimpleAccess: Returns the name of the person, or and empty string if the person is None @param person: Person object - @type person: L{RelLib.Person} + @type person: L{gen.lib.Person} @return: Returns the name of the person based of the program preferences @rtype: unicode """ - assert(isinstance(person, (RelLib.Person, NoneType))) + assert(isinstance(person, (gen.lib.Person, NoneType))) if person: return person.get_primary_name().get_surname() else: @@ -137,11 +137,11 @@ class SimpleAccess: Returns the first name of the person, or and empty string if the person is None @param person: Person object - @type person: L{RelLib.Person} + @type person: L{gen.lib.Person} @return: Returns the first name of the person based of the program preferences @rtype: unicode """ - assert(isinstance(person, (RelLib.Person, NoneType))) + assert(isinstance(person, (gen.lib.Person, NoneType))) if person: return person.get_primary_name().get_first_name() else: @@ -152,11 +152,11 @@ class SimpleAccess: Returns the GRAMPS ID of the person or family @param obj: Person or Family object - @type obj: L{RelLib.Person} or L{RelLib.Family} + @type obj: L{gen.lib.Person} or L{gen.lib.Family} @return: Returns the GRAMPS Id value of the person or family @rtype: unicode """ - assert(isinstance(obj, (RelLib.Person, RelLib.Family, NoneType))) + assert(isinstance(obj, (gen.lib.Person, gen.lib.Family, NoneType))) if obj: return obj.get_gramps_id() else: @@ -167,11 +167,11 @@ class SimpleAccess: Returns a string representing the gender of the person @param person: Person object - @type person: L{RelLib.Person} + @type person: L{gen.lib.Person} @return: Returns a string indentifying the person's gender @rtype: unicode """ - assert(isinstance(person, (RelLib.Person, NoneType))) + assert(isinstance(person, (gen.lib.Person, NoneType))) if person: return Utils.gender[person.get_gender()] return u'' @@ -181,13 +181,13 @@ class SimpleAccess: Returns a person associated as a parent of the person @param person: Person object - @type person: L{RelLib.Person} + @type person: L{gen.lib.Person} @param func: function used to extract the appropriate parent @type func: function @return: mother or father of the associated person - @rtype: L{RelLib.Person} + @rtype: L{gen.lib.Person} """ - assert(isinstance(person, (RelLib.Person, NoneType))) + assert(isinstance(person, (gen.lib.Person, NoneType))) if person: parent_handle_list = person.get_parent_family_handle_list() @@ -202,13 +202,13 @@ class SimpleAccess: Returns a person associated as a parent of the family @param family: Family object - @type family: L{RelLib.Family} + @type family: L{gen.lib.Family} @param func: function used to extract the appropriate parent @type func: function @return: mother or father of the associated family - @rtype: L{RelLib.Family} + @rtype: L{gen.lib.Family} """ - assert(isinstance(family, (RelLib.Family, NoneType))) + assert(isinstance(family, (gen.lib.Family, NoneType))) if family: handle = func(family) @@ -221,13 +221,13 @@ class SimpleAccess: Returns a string describing the date associated with the person @param person: Person object - @type person: L{RelLib.Person} + @type person: L{gen.lib.Person} @param func: function used to extract the associated date information @type func: function @return: Returns a string describing the date @rtype: unicode """ - assert(isinstance(person, (RelLib.Person, NoneType))) + assert(isinstance(person, (gen.lib.Person, NoneType))) if person: ref = func(person) @@ -245,13 +245,13 @@ class SimpleAccess: Returns a string describing the place associated with the person @param person: Person object - @type person: L{RelLib.Person} + @type person: L{gen.lib.Person} @param func: function used to extract the associated place information @type func: function @return: Returns a string describing the place @rtype: unicode """ - assert(isinstance(person, (RelLib.Person, NoneType))) + assert(isinstance(person, (gen.lib.Person, NoneType))) if person: ref = func(person) @@ -268,11 +268,11 @@ class SimpleAccess: Returns the primary spouse of the person @param person: Person object - @type person: L{RelLib.Person} + @type person: L{gen.lib.Person} @return: The spouse identified as the person's primary spouse - @rtype: L{RelLib.Person} + @rtype: L{gen.lib.Person} """ - assert(isinstance(person, (RelLib.Person, NoneType))) + assert(isinstance(person, (gen.lib.Person, NoneType))) if person: family_handle_list = person.get_family_handle_list() @@ -293,12 +293,12 @@ class SimpleAccess: his/per primary spouse. @param person: Person object - @type person: L{RelLib.Person} + @type person: L{gen.lib.Person} @return: Returns a string describing the relationship between the person and his/per primary spouse. @rtype: unicode """ - assert(isinstance(person, (RelLib.Person, NoneType))) + assert(isinstance(person, (gen.lib.Person, NoneType))) if person: family_handle_list = person.get_family_handle_list() @@ -315,12 +315,12 @@ class SimpleAccess: where married. @param person: Person object - @type person: L{RelLib.Person} + @type person: L{gen.lib.Person} @return: Returns a string describing the place where the person and his/her spouse where married. @rtype: unicode """ - assert(isinstance(person, (RelLib.Person, NoneType))) + assert(isinstance(person, (gen.lib.Person, NoneType))) if person: family_handle_list = person.get_family_handle_list() @@ -345,12 +345,12 @@ class SimpleAccess: where married. @param person: Person object - @type person: L{RelLib.Person} + @type person: L{gen.lib.Person} @return: Returns a string indicicating the date when the person and his/her spouse where married. @rtype: unicode """ - assert(isinstance(person, (RelLib.Person, NoneType))) + assert(isinstance(person, (gen.lib.Person, NoneType))) if person: family_handle_list = person.get_family_handle_list() @@ -375,13 +375,13 @@ class SimpleAccess: Returns a list of the children as the children of the primary spouse. @param obj: Person or Family object - @type obj: L{RelLib.Person} or L{RelLib.Family} - @return: Returns a list of L{RelLib.Person} objects representing the children + @type obj: L{gen.lib.Person} or L{gen.lib.Family} + @return: Returns a list of L{gen.lib.Person} objects representing the children @rtype: list """ - assert(isinstance(obj, (RelLib.Person, RelLib.Family, NoneType))) + assert(isinstance(obj, (gen.lib.Person, gen.lib.Family, NoneType))) - if isinstance(obj, RelLib.Person): + if isinstance(obj, gen.lib.Person): family_handle_list = obj.get_family_handle_list() if family_handle_list: family_id = family_handle_list[0] @@ -389,7 +389,7 @@ class SimpleAccess: return [ self.dbase.get_person_from_handle(hndl.ref) for hndl in family.get_child_ref_list() ] - elif isinstance(obj, RelLib.Family): + elif isinstance(obj, gen.lib.Family): return [ self.dbase.get_person_from_handle(hndl.ref) for hndl in obj.get_child_ref_list() ] return [] @@ -400,15 +400,15 @@ class SimpleAccess: family. @param obj: Person or Family object - @type obj: L{RelLib.Person} or L{RelLib.Family} + @type obj: L{gen.lib.Person} or L{gen.lib.Family} @return: The father in the person's primary family or the father of the family - @rtype: L{RelLib.Person} + @rtype: L{gen.lib.Person} """ - if isinstance(obj, RelLib.Person): - return self.__parent(obj, RelLib.Family.get_father_handle) - elif isinstance(obj, RelLib.Family): - return self.__family_parent(obj, RelLib.Family.get_father_handle) + if isinstance(obj, gen.lib.Person): + return self.__parent(obj, gen.lib.Family.get_father_handle) + elif isinstance(obj, gen.lib.Family): + return self.__family_parent(obj, gen.lib.Family.get_father_handle) else: return None @@ -418,15 +418,15 @@ class SimpleAccess: family. @param obj: Person object - @type obj: L{RelLib.Person} or L{RelLib.Family} + @type obj: L{gen.lib.Person} or L{gen.lib.Family} @return: The mother in the person's primary family or the mother of the family - @rtype: L{RelLib.Person} + @rtype: L{gen.lib.Person} """ - if isinstance(obj, RelLib.Person): - return self.__parent(obj, RelLib.Family.get_mother_handle) - elif isinstance(obj, RelLib.Family): - return self.__family_parent(obj, RelLib.Family.get_mother_handle) + if isinstance(obj, gen.lib.Person): + return self.__parent(obj, gen.lib.Family.get_mother_handle) + elif isinstance(obj, gen.lib.Family): + return self.__family_parent(obj, gen.lib.Family.get_mother_handle) else: return None @@ -435,55 +435,55 @@ class SimpleAccess: Returns a string indicating the date when the person's birth. @param person: Person object - @type person: L{RelLib.Person} + @type person: L{gen.lib.Person} @return: Returns a string indicating the date when the person's birth. @rtype: unicode """ - return self.__event_date(person, RelLib.Person.get_birth_ref) + return self.__event_date(person, gen.lib.Person.get_birth_ref) def birth_place(self, person): """ Returns a string indicating the place of the person's birth. @param person: Person object - @type person: L{RelLib.Person} + @type person: L{gen.lib.Person} @return: Returns a string indicating the place of the person's birth. @rtype: unicode """ - return self.__event_place(person, RelLib.Person.get_birth_ref) + return self.__event_place(person, gen.lib.Person.get_birth_ref) def death_date(self, person): """ Returns a string indicating the date when the person's death. @param person: Person object - @type person: L{RelLib.Person} + @type person: L{gen.lib.Person} @return: Returns a string indicating the date when the person's death. @rtype: unicode """ - return self.__event_date(person, RelLib.Person.get_death_ref) + return self.__event_date(person, gen.lib.Person.get_death_ref) def death_place(self, person): """ Returns a string indicating the place of the person's death. @param person: Person object - @type person: L{RelLib.Person} + @type person: L{gen.lib.Person} @return: Returns a string indicating the place of the person's death. @rtype: unicode """ - return self.__event_place(person, RelLib.Person.get_death_ref) + return self.__event_place(person, gen.lib.Person.get_death_ref) def event_place(self, event): """ Returns a string indicating the place of the event @param event: Event object - @type event: L{RelLib.Event} + @type event: L{gen.lib.Event} @return: Returns a string indicating the place of the event @rtype: unicode """ - assert(isinstance(event, (RelLib.Event, NoneType))) + assert(isinstance(event, (gen.lib.Event, NoneType))) if event: place_handle = event.get_place_handle() @@ -496,11 +496,11 @@ class SimpleAccess: Returns a string indicating the date of the event @param event: Event object - @type event: L{RelLib.Event} + @type event: L{gen.lib.Event} @return: Returns a string indicating the date of the event @rtype: unicode """ - assert(isinstance(event, (RelLib.Event, NoneType))) + assert(isinstance(event, (gen.lib.Event, NoneType))) date_obj = event.get_date_object() if date_obj: return DateHandler.displayer.display(date_obj) @@ -512,11 +512,11 @@ class SimpleAccess: Returns a string indicating the type of the event @param event: Event object - @type event: L{RelLib.Event} + @type event: L{gen.lib.Event} @return: Returns a string indicating the type of the event @rtype: unicode """ - assert(isinstance(event, (RelLib.Event, NoneType))) + assert(isinstance(event, (gen.lib.Event, NoneType))) if event: return str(event.get_type()) else: @@ -525,17 +525,17 @@ class SimpleAccess: def events(self, obj, restrict=None): """ Returns a list of events associated with the object. This object - can be either a L{RelLib.Person} or L{RelLib.Family}. + can be either a L{gen.lib.Person} or L{gen.lib.Family}. @param obj: Person or Family - @type obj: L{RelLib.Person} or L{RelLib.Family} + @type obj: L{gen.lib.Person} or L{gen.lib.Family} @param restrict: Optional list of strings that will limit the types of events to those of the specfied types. @type restrict: list @return: list of events assocated with the object @rtype: list """ - assert(isinstance(obj, (RelLib.Person, RelLib.Family, NoneType))) + assert(isinstance(obj, (gen.lib.Person, gen.lib.Family, NoneType))) assert(type(restrict) == type([]) or restrict == None) if obj: @@ -553,14 +553,14 @@ class SimpleAccess: def sources(self, obj): """ Returns a list of events associated with the object. This object - can be either a L{RelLib.Person} or L{RelLib.Family}. + can be either a L{gen.lib.Person} or L{gen.lib.Family}. @param obj: Person or Family - @type obj: L{RelLib.Person} or L{RelLib.Family} + @type obj: L{gen.lib.Person} or L{gen.lib.Family} @return: list of events assocated with the object @rtype: list """ - assert(isinstance(obj, (RelLib.Person, RelLib.Family, RelLib.Event, NoneType))) + assert(isinstance(obj, (gen.lib.Person, gen.lib.Family, gen.lib.Event, NoneType))) if obj: handles = [ ref.ref for ref in obj.get_source_references() ] @@ -573,12 +573,12 @@ class SimpleAccess: Returns a list of families in which the person is listed as a parent. @param person: Person object - @type person: L{RelLib.Person} - @return: list of L{RelLib.Family} objects in which the person is listed + @type person: L{gen.lib.Person} + @return: list of L{gen.lib.Family} objects in which the person is listed as a parent. @rtype: list """ - assert(isinstance(person, (RelLib.Person, NoneType))) + assert(isinstance(person, (gen.lib.Person, NoneType))) if person: return [ self.dbase.get_family_from_handle(handle) @@ -590,12 +590,12 @@ class SimpleAccess: Returns a list of families in which the person is listed as a child. @param person: Person object - @type person: L{RelLib.Person} - @return: list of L{RelLib.Family} objects in which the person is listed + @type person: L{gen.lib.Person} + @return: list of L{gen.lib.Family} objects in which the person is listed as a child. @rtype: list """ - assert(isinstance(person, (RelLib.Person, NoneType))) + assert(isinstance(person, (gen.lib.Person, NoneType))) if person: return [ self.dbase.get_family_from_handle(handle) @@ -688,11 +688,11 @@ class SimpleAccess: Returns the title of the source. @param source: Source object - @type source: L{RelLib.Source} + @type source: L{gen.lib.Source} @return: title of the source @rtype: unicode """ - assert(isinstance(source, (RelLib.Source, NoneType))) + assert(isinstance(source, (gen.lib.Source, NoneType))) if source: return source.get_title() return u'' @@ -702,11 +702,11 @@ class SimpleAccess: Returns the author of the source. @param source: Source object - @type source: L{RelLib.Source} + @type source: L{gen.lib.Source} @return: author of the source @rtype: unicode """ - assert(isinstance(source, (RelLib.Source, NoneType))) + assert(isinstance(source, (gen.lib.Source, NoneType))) if source: return source.get_author() return u'' diff --git a/src/Sort.py b/src/Sort.py index a03a2e4a6..7d9ea35c1 100644 --- a/src/Sort.py +++ b/src/Sort.py @@ -39,7 +39,7 @@ import locale # GRAMPS Modules # #------------------------------------------------------------------------- -from RelLib import Date +from gen.lib import Date from BasicUtils import name_displayer as _nd #------------------------------------------------------------------------- diff --git a/src/SubstKeywords.py b/src/SubstKeywords.py index 7c46f3937..6ed4075c4 100644 --- a/src/SubstKeywords.py +++ b/src/SubstKeywords.py @@ -43,7 +43,7 @@ __version__ = "$Revision$" from BasicUtils import name_displayer import DateHandler -import RelLib +import gen.lib #------------------------------------------------------------------------ # @@ -118,7 +118,7 @@ class SubstKeywords: if not e_ref: continue e = database.get_event_from_handle(e_ref.ref) - if e.get_type() == RelLib.EventType.MARRIAGE: + if e.get_type() == gen.lib.EventType.MARRIAGE: self.m = DateHandler.get_date(e) mplace_handle = e.get_place_handle() if mplace_handle: diff --git a/src/ToolTips.py b/src/ToolTips.py index 97557ba4a..25d0396e4 100644 --- a/src/ToolTips.py +++ b/src/ToolTips.py @@ -64,7 +64,7 @@ from gettext import gettext as _ # GRAMPS modules # #------------------------------------------------------------------------- -import RelLib +import gen.lib import DateHandler #------------------------------------------------------------------------- @@ -248,7 +248,7 @@ class FamilyTip: CLASS_MAP = { - RelLib.Repository : RepositoryTip, - RelLib.Person : PersonTip, - RelLib.Family : FamilyTip + gen.lib.Repository : RepositoryTip, + gen.lib.Person : PersonTip, + gen.lib.Family : FamilyTip } diff --git a/src/TreeViews/_PersonTreeView.py b/src/TreeViews/_PersonTreeView.py index 0da411457..c6a7324c7 100644 --- a/src/TreeViews/_PersonTreeView.py +++ b/src/TreeViews/_PersonTreeView.py @@ -8,7 +8,7 @@ from Models import \ PersonTreeModel, PersonListModel, PersonFilterModel from BasicUtils import name_displayer -from RelLib import Event +from gen.lib import Event import DateHandler import Utils diff --git a/src/Utils.py b/src/Utils.py index a7a7b4231..b4015caac 100644 --- a/src/Utils.py +++ b/src/Utils.py @@ -47,7 +47,7 @@ import gtk #------------------------------------------------------------------------- import Mime from BasicUtils import name_displayer -import RelLib +import gen.lib import Errors from QuestionDialog import WarningDialog @@ -57,31 +57,31 @@ from QuestionDialog import WarningDialog # #------------------------------------------------------------------------- gender = { - RelLib.Person.MALE : _("male"), - RelLib.Person.FEMALE : _("female"), - RelLib.Person.UNKNOWN : _("unknown"), + gen.lib.Person.MALE : _("male"), + gen.lib.Person.FEMALE : _("female"), + gen.lib.Person.UNKNOWN : _("unknown"), } def format_gender( type): return gender.get(type[0], _("Invalid")) confidence = { - RelLib.SourceRef.CONF_VERY_HIGH : _("Very High"), - RelLib.SourceRef.CONF_HIGH : _("High"), - RelLib.SourceRef.CONF_NORMAL : _("Normal"), - RelLib.SourceRef.CONF_LOW : _("Low"), - RelLib.SourceRef.CONF_VERY_LOW : _("Very Low"), + gen.lib.SourceRef.CONF_VERY_HIGH : _("Very High"), + gen.lib.SourceRef.CONF_HIGH : _("High"), + gen.lib.SourceRef.CONF_NORMAL : _("Normal"), + gen.lib.SourceRef.CONF_LOW : _("Low"), + gen.lib.SourceRef.CONF_VERY_LOW : _("Very Low"), } family_rel_descriptions = { - RelLib.FamilyRelType.MARRIED : _("A legal or common-law relationship " + gen.lib.FamilyRelType.MARRIED : _("A legal or common-law relationship " "between a husband and wife"), - RelLib.FamilyRelType.UNMARRIED : _("No legal or common-law relationship " + gen.lib.FamilyRelType.UNMARRIED : _("No legal or common-law relationship " "between man and woman"), - RelLib.FamilyRelType.CIVIL_UNION : _("An established relationship between " + gen.lib.FamilyRelType.CIVIL_UNION : _("An established relationship between " "members of the same sex"), - RelLib.FamilyRelType.UNKNOWN : _("Unknown relationship between a man " + gen.lib.FamilyRelType.UNKNOWN : _("Unknown relationship between a man " "and woman"), - RelLib.FamilyRelType.CUSTOM : _("An unspecified relationship " + gen.lib.FamilyRelType.CUSTOM : _("An unspecified relationship " "a man and woman"), } @@ -539,9 +539,9 @@ def probably_alive(person, db, current_year=None, limit=0): # If the recorded death year is before current year then # things are simple. death_ref = person.get_death_ref() - if death_ref and death_ref.get_role() == RelLib.EventRoleType.PRIMARY: + if death_ref and death_ref.get_role() == gen.lib.EventRoleType.PRIMARY: death = db.get_event_from_handle(death_ref.ref) - if death.get_date_object().get_start_date() != RelLib.Date.EMPTY: + if death.get_date_object().get_start_date() != gen.lib.Date.EMPTY: death_year = death.get_date_object().get_year() if death_year + limit < current_year: return False @@ -550,12 +550,12 @@ def probably_alive(person, db, current_year=None, limit=0): # These are fairly good indications that someone's not alive. for ev_ref in person.get_primary_event_ref_list(): ev = db.get_event_from_handle(ev_ref.ref) - if ev and int(ev.get_type()) in [RelLib.EventType.CAUSE_DEATH, - RelLib.EventType.BURIAL, - RelLib.EventType.CREMATION]: + if ev and int(ev.get_type()) in [gen.lib.EventType.CAUSE_DEATH, + gen.lib.EventType.BURIAL, + gen.lib.EventType.CREMATION]: if not death_year: death_year = ev.get_date_object().get_year() - if ev.get_date_object().get_start_date() != RelLib.Date.EMPTY: + if ev.get_date_object().get_start_date() != gen.lib.Date.EMPTY: if ev.get_date_object().get_year() + limit < current_year: return False # For any other event of this person, check whether it happened @@ -567,9 +567,9 @@ def probably_alive(person, db, current_year=None, limit=0): # If they were born within 100 years before current year then # assume they are alive (we already know they are not dead). birth_ref = person.get_birth_ref() - if birth_ref and birth_ref.get_role() == RelLib.EventRoleType.PRIMARY: + if birth_ref and birth_ref.get_role() == gen.lib.EventRoleType.PRIMARY: birth = db.get_event_from_handle(birth_ref.ref) - if birth.get_date_object().get_start_date() != RelLib.Date.EMPTY: + if birth.get_date_object().get_start_date() != gen.lib.Date.EMPTY: if not birth_year: birth_year = birth.get_date_object().get_year() # Check whether the birth event is too old because the @@ -600,7 +600,7 @@ def probably_alive(person, db, current_year=None, limit=0): if child_birth_ref: child_birth = db.get_event_from_handle(child_birth_ref.ref) dobj = child_birth.get_date_object() - if dobj.get_start_date() != RelLib.Date.EMPTY: + if dobj.get_start_date() != gen.lib.Date.EMPTY: # if sibling birth date too far away, then not alive: year = dobj.get_year() if year != 0: @@ -610,7 +610,7 @@ def probably_alive(person, db, current_year=None, limit=0): if child_death_ref: child_death = db.get_event_from_handle(child_death_ref.ref) dobj = child_death.get_date_object() - if dobj.get_start_date() != RelLib.Date.EMPTY: + if dobj.get_start_date() != gen.lib.Date.EMPTY: # if sibling death date too far away, then not alive: year = dobj.get_year() if year != 0: @@ -633,8 +633,8 @@ def probably_alive(person, db, current_year=None, limit=0): if child_birth_ref: child_birth = db.get_event_from_handle(child_birth_ref.ref) dobj = child_birth.get_date_object() - if dobj.get_start_date() != RelLib.Date.EMPTY: - d = RelLib.Date(dobj) + if dobj.get_start_date() != gen.lib.Date.EMPTY: + d = gen.lib.Date(dobj) val = d.get_start_date() val = d.get_year() - years d.set_year(val) @@ -645,7 +645,7 @@ def probably_alive(person, db, current_year=None, limit=0): if child_death_ref: child_death = db.get_event_from_handle(child_death_ref.ref) dobj = child_death.get_date_object() - if dobj.get_start_date() != RelLib.Date.EMPTY: + if dobj.get_start_date() != gen.lib.Date.EMPTY: if not not_too_old (dobj, current_year): return True @@ -676,20 +676,20 @@ def probably_alive(person, db, current_year=None, limit=0): if father_handle: father = db.get_person_from_handle(father_handle) father_birth_ref = father.get_birth_ref() - if father_birth_ref and father_birth_ref.get_role() == RelLib.EventRoleType.PRIMARY: + if father_birth_ref and father_birth_ref.get_role() == gen.lib.EventRoleType.PRIMARY: father_birth = db.get_event_from_handle( father_birth_ref.ref) dobj = father_birth.get_date_object() - if dobj.get_start_date() != RelLib.Date.EMPTY: + if dobj.get_start_date() != gen.lib.Date.EMPTY: if not not_too_old (dobj, year - average_generation_gap): return True father_death_ref = father.get_death_ref() - if father_death_ref and father_death_ref.get_role() == RelLib.EventRoleType.PRIMARY: + if father_death_ref and father_death_ref.get_role() == gen.lib.EventRoleType.PRIMARY: father_death = db.get_event_from_handle( father_death_ref.ref) dobj = father_death.get_date_object() - if dobj.get_start_date() != RelLib.Date.EMPTY: + if dobj.get_start_date() != gen.lib.Date.EMPTY: if dobj.get_year() < year - average_generation_gap: return True @@ -700,19 +700,19 @@ def probably_alive(person, db, current_year=None, limit=0): if mother_handle: mother = db.get_person_from_handle(mother_handle) mother_birth_ref = mother.get_birth_ref() - if mother_birth_ref and mother_birth_ref.get_role() == RelLib.EventRoleType.PRIMARY: + if mother_birth_ref and mother_birth_ref.get_role() == gen.lib.EventRoleType.PRIMARY: mother_birth = db.get_event_from_handle(mother_birth_ref.ref) dobj = mother_birth.get_date_object() - if dobj.get_start_date() != RelLib.Date.EMPTY: + if dobj.get_start_date() != gen.lib.Date.EMPTY: if not not_too_old (dobj, year - average_generation_gap): return True mother_death_ref = mother.get_death_ref() - if mother_death_ref and mother_death_ref.get_role() == RelLib.EventRoleType.PRIMARY: + if mother_death_ref and mother_death_ref.get_role() == gen.lib.EventRoleType.PRIMARY: mother_death = db.get_event_from_handle( mother_death_ref.ref) dobj = mother_death.get_date_object() - if dobj.get_start_date() != RelLib.Date.EMPTY: + if dobj.get_start_date() != gen.lib.Date.EMPTY: if dobj.get_year() < year - average_generation_gap: return True diff --git a/src/date_test.py b/src/date_test.py index 250604e22..321b9d97d 100644 --- a/src/date_test.py +++ b/src/date_test.py @@ -51,7 +51,7 @@ gettext.install("gramps",loc,unicode=1) import DateHandler from DateHandler import parser as _dp from DateHandler import displayer as _dd -from RelLib import Date +from gen.lib import Date print locale.getlocale(locale.LC_TIME) print _dd diff --git a/src/gen/Makefile.am b/src/gen/Makefile.am index e1953d994..c9228b18f 100644 --- a/src/gen/Makefile.am +++ b/src/gen/Makefile.am @@ -3,7 +3,7 @@ # but that is not necessarily portable. # If not using GNU make, then list all .py files individually -SUBDIRS = proxy +SUBDIRS = proxy db lib utils pkgdatadir = $(datadir)/@PACKAGE@/gen diff --git a/src/gen/__init__.py b/src/gen/__init__.py index 08fcba51c..ec984dbfb 100644 --- a/src/gen/__init__.py +++ b/src/gen/__init__.py @@ -19,4 +19,4 @@ # __version__ = "$Revision: $" -__all__ = [ "proxy", "db" ] +__all__ = [ "proxy", "db", "lib", "utils" ] diff --git a/src/gen/db/base.py b/src/gen/db/base.py index 0e3d63102..44a7ee5be 100644 --- a/src/gen/db/base.py +++ b/src/gen/db/base.py @@ -50,7 +50,7 @@ LOG = logging.getLogger(".GrampsDb") # GRAMPS libraries # #------------------------------------------------------------------------- -from RelLib import * +from gen.lib import * from callback import GrampsDBCallback from iterator import CursorIterator diff --git a/src/gen/db/dbdir.py b/src/gen/db/dbdir.py index 886543eb8..4ad345e84 100644 --- a/src/gen/db/dbdir.py +++ b/src/gen/db/dbdir.py @@ -47,7 +47,7 @@ log = logging.getLogger(".GrampsDb") # Gramps modules # #------------------------------------------------------------------------- -from RelLib import * +from gen.lib import * from base import * import dbconst as const from exceptions import FileVersionError @@ -607,7 +607,11 @@ class GrampsDBDir(GrampsDbBase, UpdateCallback): self.name_formats[format_ix] = format # database owner - self.set_researcher(self.metadata.get('researcher', default=self.owner)) + try: + self.set_researcher(self.metadata.get('researcher', + default=self.owner)) + except ImportError: #handle problems with pre-alpha 3.0 + pass # bookmarks self.bookmarks.set(self.metadata.get('bookmarks',default=[])) diff --git a/src/gen/lib/Makefile.am b/src/gen/lib/Makefile.am new file mode 100644 index 000000000..3612812ee --- /dev/null +++ b/src/gen/lib/Makefile.am @@ -0,0 +1,78 @@ +# This is the src/gen/lib level Makefile for Gramps +# We could use GNU make's ':=' syntax for nice wildcard use, +# but that is not necessarily portable. +# If not using GNU make, then list all .py files individually + +pkgdatadir = $(datadir)/@PACKAGE@/lib + +pkgdata_PYTHON = \ + addressbase.py \ + address.py \ + attributeBase.py \ + attribute.py \ + attrtype.py \ + baseobj.py \ + calendar.py \ + childref.py \ + childreftype.py \ + datebase.py \ + date.py \ + event.py \ + eventref.py \ + eventroletype.py \ + eventtype.py \ + family.py \ + familyreltype.py \ + genderstats.py \ + grampstype.py \ + __init__.py \ + ldsordbase.py \ + ldsord.py \ + locationbase.py \ + location.py \ + markertype.py \ + mediabase.py \ + mediaobj.py \ + mediaref.py \ + name.py \ + nametype.py \ + notebase.py \ + note.py \ + notetype.py \ + person.py \ + personref.py \ + placebase.py \ + place.py \ + primaryobj.py \ + privacybase.py \ + privsrcnote.py \ + refbase.py \ + repo.py \ + reporef.py \ + repotype.py \ + researcher.py \ + secondaryobj.py \ + srcbase.py \ + srcmediatype.py \ + srcnote.py \ + src.py \ + srcref.py \ + urlbase.py \ + url.py \ + urltype.py \ + witness.py + +pkgpyexecdir = @pkgpyexecdir@/lib +pkgpythondir = @pkgpythondir@/lib + +# Clean up all the byte-compiled files +MOSTLYCLEANFILES = *pyc *pyo + +GRAMPS_PY_MODPATH = "../" + +pycheck: + (export PYTHONPATH=$(GRAMPS_PY_MODPATH); \ + pychecker $(pkgdata_PYTHON)); + +pylint: + pylint --disable-msg=W0403,C0103 $(pkgdata_PYTHON) diff --git a/src/gen/lib/__init__.py b/src/gen/lib/__init__.py new file mode 100644 index 000000000..2034c0b7c --- /dev/null +++ b/src/gen/lib/__init__.py @@ -0,0 +1,75 @@ +# +# Gramps - a GTK+/GNOME based genealogy program +# +# Copyright (C) 2000-2006 Donald N. Allingham +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +# $Id$ + +"""The core library of GRAMPS objects""" + +__author__ = "Donald N. Allingham" +__version__ = "$Revision$" +__revision__ = "$Revision$" + +# Dates +from date import Date, DateError + +# Secondary objects +from secondaryobj import SecondaryObject +from address import Address +from location import Location +from attribute import Attribute +from eventref import EventRef +from ldsord import LdsOrd +from mediaref import MediaRef +from name import Name +from note import Note +from reporef import RepoRef +from srcref import SourceRef +from url import Url +from witness import Witness +from childref import ChildRef + +# Primary objects +from primaryobj import PrimaryObject +from person import Person +from personref import PersonRef +from family import Family +from event import Event +from place import Place +from src import Source +from mediaobj import MediaObject +from repo import Repository + +# These are actually metadata +from genderstats import GenderStats +from researcher import Researcher + +# Type classes +from grampstype import GrampsType +from nametype import NameType +from attrtype import AttributeType +from urltype import UrlType +from childreftype import ChildRefType +from repotype import RepositoryType +from eventtype import EventType +from familyreltype import FamilyRelType +from srcmediatype import SourceMediaType +from eventroletype import EventRoleType +from markertype import MarkerType +from notetype import NoteType diff --git a/src/RelLib/_Address.py b/src/gen/lib/address.py similarity index 94% rename from src/RelLib/_Address.py rename to src/gen/lib/address.py index 83eb8ba57..b5fc4fcae 100644 --- a/src/RelLib/_Address.py +++ b/src/gen/lib/address.py @@ -31,12 +31,12 @@ __revision__ = "$Revision$" # GRAMPS modules # #------------------------------------------------------------------------- -from _SecondaryObject import SecondaryObject -from _PrivacyBase import PrivacyBase -from _SourceBase import SourceBase -from _NoteBase import NoteBase -from _DateBase import DateBase -from _LocationBase import LocationBase +from secondaryobj import SecondaryObject +from privacybase import PrivacyBase +from srcbase import SourceBase +from notebase import NoteBase +from datebase import DateBase +from locationbase import LocationBase #------------------------------------------------------------------------- # diff --git a/src/RelLib/_AddressBase.py b/src/gen/lib/addressbase.py similarity index 99% rename from src/RelLib/_AddressBase.py rename to src/gen/lib/addressbase.py index 1bc6760b1..0d2ac6591 100644 --- a/src/RelLib/_AddressBase.py +++ b/src/gen/lib/addressbase.py @@ -31,7 +31,7 @@ __revision__ = "$Revision$" # GRAMPS modules # #------------------------------------------------------------------------- -from _Address import Address +from address import Address #------------------------------------------------------------------------- # diff --git a/src/RelLib/_Attribute.py b/src/gen/lib/attribute.py similarity index 95% rename from src/RelLib/_Attribute.py rename to src/gen/lib/attribute.py index 4c9f399b4..e2cf1ade7 100644 --- a/src/RelLib/_Attribute.py +++ b/src/gen/lib/attribute.py @@ -31,11 +31,11 @@ __revision__ = "$Revision$" # GRAMPS modules # #------------------------------------------------------------------------- -from _SecondaryObject import SecondaryObject -from _PrivacyBase import PrivacyBase -from _SourceBase import SourceBase -from _NoteBase import NoteBase -from _AttributeType import AttributeType +from secondaryobj import SecondaryObject +from privacybase import PrivacyBase +from srcbase import SourceBase +from notebase import NoteBase +from attrtype import AttributeType #------------------------------------------------------------------------- # diff --git a/src/RelLib/_AttributeBase.py b/src/gen/lib/attributeBase.py similarity index 99% rename from src/RelLib/_AttributeBase.py rename to src/gen/lib/attributeBase.py index 87ea8efdc..15363f057 100644 --- a/src/RelLib/_AttributeBase.py +++ b/src/gen/lib/attributeBase.py @@ -31,7 +31,7 @@ __revision__ = "$Revision$" # GRAMPS modules # #------------------------------------------------------------------------- -from _Attribute import Attribute +from attribute import Attribute #------------------------------------------------------------------------- # diff --git a/src/RelLib/_AttributeType.py b/src/gen/lib/attrtype.py similarity index 98% rename from src/RelLib/_AttributeType.py rename to src/gen/lib/attrtype.py index 6cd9944c0..12ea3974c 100644 --- a/src/RelLib/_AttributeType.py +++ b/src/gen/lib/attrtype.py @@ -24,7 +24,7 @@ Provides the different Attribute Types for GRAMPS """ -from _GrampsType import GrampsType, init_map +from grampstype import GrampsType, init_map from gettext import gettext as _ __revision__ = "$Revision$" diff --git a/src/RelLib/_BaseObject.py b/src/gen/lib/baseobj.py similarity index 100% rename from src/RelLib/_BaseObject.py rename to src/gen/lib/baseobj.py diff --git a/src/RelLib/_CalSdn.py b/src/gen/lib/calendar.py similarity index 100% rename from src/RelLib/_CalSdn.py rename to src/gen/lib/calendar.py diff --git a/src/RelLib/_ChildRef.py b/src/gen/lib/childref.py similarity index 95% rename from src/RelLib/_ChildRef.py rename to src/gen/lib/childref.py index 8c7da5abd..336eb5e7d 100644 --- a/src/RelLib/_ChildRef.py +++ b/src/gen/lib/childref.py @@ -33,12 +33,12 @@ from types import InstanceType # GRAMPS modules # #------------------------------------------------------------------------- -from _SecondaryObject import SecondaryObject -from _PrivacyBase import PrivacyBase -from _SourceBase import SourceBase -from _NoteBase import NoteBase -from _RefBase import RefBase -from _ChildRefType import ChildRefType +from secondaryobj import SecondaryObject +from privacybase import PrivacyBase +from srcbase import SourceBase +from notebase import NoteBase +from refbase import RefBase +from childreftype import ChildRefType #------------------------------------------------------------------------- # diff --git a/src/RelLib/_ChildRefType.py b/src/gen/lib/childreftype.py similarity index 97% rename from src/RelLib/_ChildRefType.py rename to src/gen/lib/childreftype.py index 4dda4b850..b8a4be696 100644 --- a/src/RelLib/_ChildRefType.py +++ b/src/gen/lib/childreftype.py @@ -24,7 +24,7 @@ Provides the different child reference types """ -from _GrampsType import GrampsType, init_map +from grampstype import GrampsType, init_map from gettext import gettext as _ __revision__ = "$Revision$" diff --git a/src/RelLib/_Date.py b/src/gen/lib/date.py similarity index 99% rename from src/RelLib/_Date.py rename to src/gen/lib/date.py index cc963e431..59ff703cc 100644 --- a/src/RelLib/_Date.py +++ b/src/gen/lib/date.py @@ -53,7 +53,7 @@ log = logging.getLogger(".Date") # Gramps modules # #------------------------------------------------------------------------ -from _CalSdn import * +from calendar import * #------------------------------------------------------------------------ # @@ -68,7 +68,7 @@ try: _DATE_AFTER_RANGE = Config.get(Config.DATE_AFTER_RANGE) _DATE_ABOUT_RANGE = Config.get(Config.DATE_ABOUT_RANGE) except ImportError: - # RelLib used as module not part of GRAMPS + # gen.lib used as module not part of GRAMPS _DATE_BEFORE_RANGE = 9999 _DATE_AFTER_RANGE = 9999 _DATE_ABOUT_RANGE = 10 @@ -323,7 +323,7 @@ class Date: # representations # Use text as originally given or display date to format # in preferences? That is use self.text or displayer ? - # It is unclean to import DateHandler in RelLib ! + # It is unclean to import DateHandler in gen.lib ! ###self_text = displayer.display(self) self_text = self.text ##DEBUG: print ' TEXT COMPARE ONLY ' @@ -762,7 +762,7 @@ class Date: if __name__ == "__main__": # Test function. Call it as follows from the command line (so as to find # imported modules): - # export PYTHONPATH=/path/to/gramps/src python src/RelLib/_Date.py + # export PYTHONPATH=/path/to/gramps/src python src/gen.lib/_Date.py # from DateHandler import _DateParser df = _DateParser.DateParser() # date factory diff --git a/src/RelLib/_DateBase.py b/src/gen/lib/datebase.py similarity index 99% rename from src/RelLib/_DateBase.py rename to src/gen/lib/datebase.py index cde1400d8..29736719f 100644 --- a/src/RelLib/_DateBase.py +++ b/src/gen/lib/datebase.py @@ -33,7 +33,7 @@ from types import InstanceType # GRAMPS modules # #------------------------------------------------------------------------- -from _Date import Date +from date import Date #------------------------------------------------------------------------- # diff --git a/src/RelLib/_Event.py b/src/gen/lib/event.py similarity index 96% rename from src/RelLib/_Event.py rename to src/gen/lib/event.py index 760c3f042..3892ac945 100644 --- a/src/RelLib/_Event.py +++ b/src/gen/lib/event.py @@ -31,15 +31,15 @@ __revision__ = "$Revision$" # GRAMPS modules # #------------------------------------------------------------------------- -from _PrimaryObject import PrimaryObject -from _SourceBase import SourceBase -from _NoteBase import NoteBase -from _MediaBase import MediaBase -from _AttributeBase import AttributeBase -from _DateBase import DateBase -from _PlaceBase import PlaceBase -from _EventType import EventType -from _MarkerType import MarkerType +from primaryobj import PrimaryObject +from srcbase import SourceBase +from notebase import NoteBase +from mediabase import MediaBase +from attributeBase import AttributeBase +from datebase import DateBase +from placebase import PlaceBase +from eventtype import EventType +from markertype import MarkerType from types import InstanceType diff --git a/src/RelLib/_EventRef.py b/src/gen/lib/eventref.py similarity index 94% rename from src/RelLib/_EventRef.py rename to src/gen/lib/eventref.py index 5608429df..95c8a7995 100644 --- a/src/RelLib/_EventRef.py +++ b/src/gen/lib/eventref.py @@ -33,12 +33,12 @@ from types import InstanceType # GRAMPS modules # #------------------------------------------------------------------------- -from _SecondaryObject import SecondaryObject -from _PrivacyBase import PrivacyBase -from _NoteBase import NoteBase -from _AttributeBase import AttributeBase -from _RefBase import RefBase -from _EventRoleType import EventRoleType +from secondaryobj import SecondaryObject +from privacybase import PrivacyBase +from notebase import NoteBase +from attributeBase import AttributeBase +from refbase import RefBase +from eventroletype import EventRoleType #------------------------------------------------------------------------- # diff --git a/src/RelLib/_EventRoleType.py b/src/gen/lib/eventroletype.py similarity index 97% rename from src/RelLib/_EventRoleType.py rename to src/gen/lib/eventroletype.py index 22b117aaa..484d9c57b 100644 --- a/src/RelLib/_EventRoleType.py +++ b/src/gen/lib/eventroletype.py @@ -25,7 +25,7 @@ Provides the different event roles __revision__ = "$Revision$" -from _GrampsType import GrampsType, init_map +from grampstype import GrampsType, init_map from gettext import gettext as _ class EventRoleType(GrampsType): diff --git a/src/RelLib/_EventType.py b/src/gen/lib/eventtype.py similarity index 99% rename from src/RelLib/_EventType.py rename to src/gen/lib/eventtype.py index 9c4d741bc..18a57f7c1 100644 --- a/src/RelLib/_EventType.py +++ b/src/gen/lib/eventtype.py @@ -26,7 +26,7 @@ Provides the different event types __revision__ = "$Revision$" -from _GrampsType import GrampsType, init_map +from grampstype import GrampsType, init_map from gettext import gettext as _ class EventType(GrampsType): diff --git a/src/RelLib/_Family.py b/src/gen/lib/family.py similarity index 98% rename from src/RelLib/_Family.py rename to src/gen/lib/family.py index 9af21907c..08196f406 100644 --- a/src/RelLib/_Family.py +++ b/src/gen/lib/family.py @@ -39,16 +39,16 @@ from types import InstanceType # GRAMPS modules # #------------------------------------------------------------------------- -from _PrimaryObject import PrimaryObject -from _SourceBase import SourceBase -from _NoteBase import NoteBase -from _MediaBase import MediaBase -from _AttributeBase import AttributeBase -from _EventRef import EventRef -from _LdsOrdBase import LdsOrdBase -from _ChildRef import ChildRef -from _FamilyRelType import FamilyRelType -from _MarkerType import MarkerType +from primaryobj import PrimaryObject +from srcbase import SourceBase +from notebase import NoteBase +from mediabase import MediaBase +from attributeBase import AttributeBase +from eventref import EventRef +from ldsordbase import LdsOrdBase +from childref import ChildRef +from familyreltype import FamilyRelType +from markertype import MarkerType #------------------------------------------------------------------------- # diff --git a/src/RelLib/_FamilyRelType.py b/src/gen/lib/familyreltype.py similarity index 97% rename from src/RelLib/_FamilyRelType.py rename to src/gen/lib/familyreltype.py index ba477e905..56fc01e16 100644 --- a/src/RelLib/_FamilyRelType.py +++ b/src/gen/lib/familyreltype.py @@ -25,7 +25,7 @@ Provides the different family reference types __revision__ = "$Revision$" -from _GrampsType import GrampsType, init_map +from grampstype import GrampsType, init_map from gettext import gettext as _ class FamilyRelType(GrampsType): diff --git a/src/RelLib/_GenderStats.py b/src/gen/lib/genderstats.py similarity index 99% rename from src/RelLib/_GenderStats.py rename to src/gen/lib/genderstats.py index cbbfa569b..8594abd2f 100644 --- a/src/RelLib/_GenderStats.py +++ b/src/gen/lib/genderstats.py @@ -31,7 +31,7 @@ __revision__ = "$Revision$" # GRAMPS modules # #------------------------------------------------------------------------- -from _Person import Person +from person import Person #------------------------------------------------------------------------- # diff --git a/src/RelLib/_GrampsType.py b/src/gen/lib/grampstype.py similarity index 100% rename from src/RelLib/_GrampsType.py rename to src/gen/lib/grampstype.py diff --git a/src/RelLib/_LdsOrd.py b/src/gen/lib/ldsord.py similarity index 97% rename from src/RelLib/_LdsOrd.py rename to src/gen/lib/ldsord.py index d6234b9ab..14a26adf1 100644 --- a/src/RelLib/_LdsOrd.py +++ b/src/gen/lib/ldsord.py @@ -38,12 +38,12 @@ from warnings import warn # GRAMPS modules # #------------------------------------------------------------------------- -from _SecondaryObject import SecondaryObject -from _SourceBase import SourceBase -from _NoteBase import NoteBase -from _DateBase import DateBase -from _PlaceBase import PlaceBase -from _PrivacyBase import PrivacyBase +from secondaryobj import SecondaryObject +from srcbase import SourceBase +from notebase import NoteBase +from datebase import DateBase +from placebase import PlaceBase +from privacybase import PrivacyBase #------------------------------------------------------------------------- # diff --git a/src/RelLib/_LdsOrdBase.py b/src/gen/lib/ldsordbase.py similarity index 99% rename from src/RelLib/_LdsOrdBase.py rename to src/gen/lib/ldsordbase.py index 0edecda99..56e04a82b 100644 --- a/src/RelLib/_LdsOrdBase.py +++ b/src/gen/lib/ldsordbase.py @@ -31,7 +31,7 @@ __revision__ = "$Revision$" # GRAMPS modules # #------------------------------------------------------------------------- -from _LdsOrd import LdsOrd +from ldsord import LdsOrd #------------------------------------------------------------------------- # diff --git a/src/RelLib/_Location.py b/src/gen/lib/location.py similarity index 97% rename from src/RelLib/_Location.py rename to src/gen/lib/location.py index 1269a8609..b506f679c 100644 --- a/src/RelLib/_Location.py +++ b/src/gen/lib/location.py @@ -31,8 +31,8 @@ __revision__ = "$Revision$" # GRAMPS modules # #------------------------------------------------------------------------- -from _SecondaryObject import SecondaryObject -from _LocationBase import LocationBase +from secondaryobj import SecondaryObject +from locationbase import LocationBase #------------------------------------------------------------------------- # diff --git a/src/RelLib/_LocationBase.py b/src/gen/lib/locationbase.py similarity index 100% rename from src/RelLib/_LocationBase.py rename to src/gen/lib/locationbase.py diff --git a/src/RelLib/_MarkerType.py b/src/gen/lib/markertype.py similarity index 98% rename from src/RelLib/_MarkerType.py rename to src/gen/lib/markertype.py index 9b64e79cb..c9abdef16 100644 --- a/src/RelLib/_MarkerType.py +++ b/src/gen/lib/markertype.py @@ -25,7 +25,7 @@ Marker types __revision__ = "$Revision$" -from _GrampsType import GrampsType, init_map +from grampstype import GrampsType, init_map from gettext import gettext as _ class MarkerType(GrampsType): diff --git a/src/RelLib/_MediaBase.py b/src/gen/lib/mediabase.py similarity index 99% rename from src/RelLib/_MediaBase.py rename to src/gen/lib/mediabase.py index 4dd426175..022a76afc 100644 --- a/src/RelLib/_MediaBase.py +++ b/src/gen/lib/mediabase.py @@ -31,7 +31,7 @@ __revision__ = "$Revision$" # GRAMPS modules # #------------------------------------------------------------------------- -from _MediaRef import MediaRef +from mediaref import MediaRef #------------------------------------------------------------------------- # diff --git a/src/RelLib/_MediaObject.py b/src/gen/lib/mediaobj.py similarity index 95% rename from src/RelLib/_MediaObject.py rename to src/gen/lib/mediaobj.py index 314a6641e..06e1965c8 100644 --- a/src/RelLib/_MediaObject.py +++ b/src/gen/lib/mediaobj.py @@ -39,19 +39,20 @@ from types import InstanceType # GRAMPS modules # #------------------------------------------------------------------------- -from _PrimaryObject import PrimaryObject -from _SourceBase import SourceBase -from _NoteBase import NoteBase -from _DateBase import DateBase -from _AttributeBase import AttributeBase -from _MarkerType import MarkerType +from primaryobj import PrimaryObject +from srcbase import SourceBase +from notebase import NoteBase +from datebase import DateBase +from attributeBase import AttributeBase +from markertype import MarkerType #------------------------------------------------------------------------- # # MediaObject class # #------------------------------------------------------------------------- -class MediaObject(SourceBase,NoteBase,DateBase,AttributeBase,PrimaryObject): +class MediaObject(SourceBase, NoteBase, DateBase, AttributeBase, + PrimaryObject): """ Containter for information about an image file, including location, description and privacy diff --git a/src/RelLib/_MediaRef.py b/src/gen/lib/mediaref.py similarity index 94% rename from src/RelLib/_MediaRef.py rename to src/gen/lib/mediaref.py index f98694603..f711a8958 100644 --- a/src/RelLib/_MediaRef.py +++ b/src/gen/lib/mediaref.py @@ -31,12 +31,12 @@ __revision__ = "$Revision$" # GRAMPS modules # #------------------------------------------------------------------------- -from _SecondaryObject import SecondaryObject -from _PrivacyBase import PrivacyBase -from _SourceBase import SourceBase -from _NoteBase import NoteBase -from _RefBase import RefBase -from _AttributeBase import AttributeBase +from secondaryobj import SecondaryObject +from privacybase import PrivacyBase +from srcbase import SourceBase +from notebase import NoteBase +from refbase import RefBase +from attributeBase import AttributeBase #------------------------------------------------------------------------- # diff --git a/src/RelLib/_Name.py b/src/gen/lib/name.py similarity index 98% rename from src/RelLib/_Name.py rename to src/gen/lib/name.py index 3e9ba21bd..bd13ee5cf 100644 --- a/src/RelLib/_Name.py +++ b/src/gen/lib/name.py @@ -31,12 +31,12 @@ __revision__ = "$Revision$" # GRAMPS modules # #------------------------------------------------------------------------- -from _SecondaryObject import SecondaryObject -from _PrivacyBase import PrivacyBase -from _SourceBase import SourceBase -from _NoteBase import NoteBase -from _DateBase import DateBase -from _NameType import NameType +from secondaryobj import SecondaryObject +from privacybase import PrivacyBase +from srcbase import SourceBase +from notebase import NoteBase +from datebase import DateBase +from nametype import NameType #------------------------------------------------------------------------- # diff --git a/src/RelLib/_NameType.py b/src/gen/lib/nametype.py similarity index 97% rename from src/RelLib/_NameType.py rename to src/gen/lib/nametype.py index 296091760..294f73bf7 100644 --- a/src/RelLib/_NameType.py +++ b/src/gen/lib/nametype.py @@ -26,7 +26,7 @@ Name types __revision__ = "$Revision$" -from _GrampsType import GrampsType, init_map +from grampstype import GrampsType, init_map from gettext import gettext as _ class NameType(GrampsType): diff --git a/src/RelLib/_Note.py b/src/gen/lib/note.py similarity index 97% rename from src/RelLib/_Note.py rename to src/gen/lib/note.py index 24940b5c8..2b6be62ab 100644 --- a/src/RelLib/_Note.py +++ b/src/gen/lib/note.py @@ -39,10 +39,10 @@ from types import InstanceType # GRAMPS modules # #------------------------------------------------------------------------- -from _BasicPrimaryObject import BasicPrimaryObject -from _NoteType import NoteType +from primaryobj import BasicPrimaryObject +from notetype import NoteType from MarkupText import ROOT_START_TAG, LEN_ROOT_START_TAG -from _MarkerType import MarkerType +from markertype import MarkerType #------------------------------------------------------------------------- # diff --git a/src/RelLib/_NoteBase.py b/src/gen/lib/notebase.py similarity index 100% rename from src/RelLib/_NoteBase.py rename to src/gen/lib/notebase.py diff --git a/src/RelLib/_NoteType.py b/src/gen/lib/notetype.py similarity index 99% rename from src/RelLib/_NoteType.py rename to src/gen/lib/notetype.py index d7541810e..64b5b99ff 100644 --- a/src/RelLib/_NoteType.py +++ b/src/gen/lib/notetype.py @@ -38,7 +38,7 @@ from gettext import gettext as _ # GRAMPS modules # #------------------------------------------------------------------------- -from _GrampsType import GrampsType, init_map +from grampstype import GrampsType, init_map class NoteType(GrampsType): diff --git a/src/RelLib/_Person.py b/src/gen/lib/person.py similarity index 98% rename from src/RelLib/_Person.py rename to src/gen/lib/person.py index 4baa3c72f..f842ed646 100644 --- a/src/RelLib/_Person.py +++ b/src/gen/lib/person.py @@ -33,20 +33,20 @@ from types import InstanceType # GRAMPS modules # #------------------------------------------------------------------------- -from _PrimaryObject import PrimaryObject -from _SourceBase import SourceBase -from _NoteBase import NoteBase -from _MediaBase import MediaBase -from _AttributeBase import AttributeBase -from _AddressBase import AddressBase -from _LdsOrdBase import LdsOrdBase -from _UrlBase import UrlBase -from _Name import Name -from _EventRef import EventRef -from _PersonRef import PersonRef -from _AttributeType import AttributeType -from _EventRoleType import EventRoleType -from _MarkerType import MarkerType +from primaryobj import PrimaryObject +from srcbase import SourceBase +from notebase import NoteBase +from mediabase import MediaBase +from attributeBase import AttributeBase +from addressbase import AddressBase +from ldsordbase import LdsOrdBase +from urlbase import UrlBase +from name import Name +from eventref import EventRef +from personref import PersonRef +from attrtype import AttributeType +from eventroletype import EventRoleType +from markertype import MarkerType #------------------------------------------------------------------------- # diff --git a/src/RelLib/_PersonRef.py b/src/gen/lib/personref.py similarity index 95% rename from src/RelLib/_PersonRef.py rename to src/gen/lib/personref.py index 8f23ba8d9..e7c3a2984 100644 --- a/src/RelLib/_PersonRef.py +++ b/src/gen/lib/personref.py @@ -31,11 +31,11 @@ __revision__ = "$Revision$" # GRAMPS modules # #------------------------------------------------------------------------- -from _SecondaryObject import SecondaryObject -from _PrivacyBase import PrivacyBase -from _SourceBase import SourceBase -from _NoteBase import NoteBase -from _RefBase import RefBase +from secondaryobj import SecondaryObject +from privacybase import PrivacyBase +from srcbase import SourceBase +from notebase import NoteBase +from refbase import RefBase #------------------------------------------------------------------------- # diff --git a/src/RelLib/_Place.py b/src/gen/lib/place.py similarity index 97% rename from src/RelLib/_Place.py rename to src/gen/lib/place.py index d0d1151e3..a71bdadc7 100644 --- a/src/RelLib/_Place.py +++ b/src/gen/lib/place.py @@ -33,13 +33,13 @@ from types import InstanceType # GRAMPS modules # #------------------------------------------------------------------------- -from _PrimaryObject import PrimaryObject -from _SourceBase import SourceBase -from _NoteBase import NoteBase -from _MediaBase import MediaBase -from _UrlBase import UrlBase -from _Location import Location -from _MarkerType import MarkerType +from primaryobj import PrimaryObject +from srcbase import SourceBase +from notebase import NoteBase +from mediabase import MediaBase +from urlbase import UrlBase +from location import Location +from markertype import MarkerType _EMPTY_LOC = Location().serialize() diff --git a/src/RelLib/_PlaceBase.py b/src/gen/lib/placebase.py similarity index 100% rename from src/RelLib/_PlaceBase.py rename to src/gen/lib/placebase.py diff --git a/src/RelLib/_BasicPrimaryObject.py b/src/gen/lib/primaryobj.py similarity index 65% rename from src/RelLib/_BasicPrimaryObject.py rename to src/gen/lib/primaryobj.py index 51a017b71..57da46c25 100644 --- a/src/RelLib/_BasicPrimaryObject.py +++ b/src/gen/lib/primaryobj.py @@ -39,9 +39,11 @@ import GrampsLocale # GRAMPS modules # #------------------------------------------------------------------------- -from _BaseObject import BaseObject -from _PrivacyBase import PrivacyBase -from _MarkerType import MarkerType +from baseobj import BaseObject +from privacybase import PrivacyBase +from markertype import MarkerType +from srcbase import SourceBase +from mediabase import MediaBase #------------------------------------------------------------------------- # @@ -243,3 +245,106 @@ class BasicPrimaryObject(BaseObject, PrivacyBase): def replace_media_references(self, old_handle, new_handle): pass + +#------------------------------------------------------------------------- +# +# Primary Object class +# +#------------------------------------------------------------------------- +class PrimaryObject(BasicPrimaryObject): + """ + The PrimaryObject is the base class for all primary objects in the + database. Primary objects are the core objects in the database. + Each object has a database handle and a GRAMPS ID value. The database + handle is used as the record number for the database, and the GRAMPS + ID is the user visible version. + """ + + def __init__(self, source=None): + """ + Initialize a PrimaryObject. If source is None, both the ID and handle + are assigned as empty strings. If source is not None, then object + is initialized from values of the source object. + + @param source: Object used to initialize the new object + @type source: PrimaryObject + """ + BasicPrimaryObject.__init__(self, source) + + def has_handle_reference(self, classname, handle): + """ + Returns True if the object has reference to a given handle + of given primary object type. + + @param classname: The name of the primary object class. + @type classname: str + @param handle: The handle to be checked. + @type handle: str + @return: Returns whether the object has reference to this handle + of this object type. + @rtype: bool + """ + if classname == 'Source' and isinstance(self, SourceBase): + return self.has_source_reference(handle) + elif classname == 'MediaObject' and isinstance(self, MediaBase): + return self.has_media_reference(handle) + else: + return self._has_handle_reference(classname, handle) + + def remove_handle_references(self, classname, handle_list): + """ + Removes all references in this object to object handles in the list. + + @param classname: The name of the primary object class. + @type classname: str + @param handle_list: The list of handles to be removed. + @type handle_list: str + """ + if classname == 'Source' and isinstance(self, SourceBase): + self.remove_source_references(handle_list) + elif classname == 'MediaObject' and isinstance(self, MediaBase): + self.remove_media_references(handle_list) + else: + self._remove_handle_references(classname, handle_list) + + def replace_handle_reference(self, classname, old_handle, new_handle): + """ + Replaces all references to old handle with those to the new handle. + + @param classname: The name of the primary object class. + @type classname: str + @param old_handle: The handle to be replaced. + @type old_handle: str + @param new_handle: The handle to replace the old one with. + @type new_handle: str + """ + if classname == 'Source' and isinstance(self, SourceBase): + self.replace_source_references(old_handle, new_handle) + elif classname == 'MediaObject' and isinstance(self, MediaBase): + self.replace_media_references(old_handle, new_handle) + else: + self._replace_handle_reference(classname, old_handle, new_handle) + + def _has_handle_reference(self, classname, handle): + """ + returns True if the handle is referenced by the object + """ + return False + + def _remove_handle_references(self, classname, handle_list): + """ + removes the handle references from the object + """ + pass + + def _replace_handle_reference(self, classname, old_handle, new_handle): + """ + replaces the handle reference with the new reference + """ + pass + + def set_marker(self, marker): + self.marker.set(marker) + + def get_marker(self): + return self.marker diff --git a/src/RelLib/_PrivacyBase.py b/src/gen/lib/privacybase.py similarity index 100% rename from src/RelLib/_PrivacyBase.py rename to src/gen/lib/privacybase.py diff --git a/src/RelLib/_PrivateSourceNote.py b/src/gen/lib/privsrcnote.py similarity index 94% rename from src/RelLib/_PrivateSourceNote.py rename to src/gen/lib/privsrcnote.py index 38c4e7f39..e6bd8dba8 100644 --- a/src/RelLib/_PrivateSourceNote.py +++ b/src/gen/lib/privsrcnote.py @@ -26,8 +26,8 @@ PrivateSourceNote class for GRAMPS __revision__ = "$Revision$" -from _SourceNote import SourceNote -from _PrivacyBase import PrivacyBase +from srcnote import SourceNote +from privacybase import PrivacyBase #------------------------------------------------------------------------- # diff --git a/src/RelLib/_RefBase.py b/src/gen/lib/refbase.py similarity index 100% rename from src/RelLib/_RefBase.py rename to src/gen/lib/refbase.py diff --git a/src/RelLib/_Repository.py b/src/gen/lib/repo.py similarity index 95% rename from src/RelLib/_Repository.py rename to src/gen/lib/repo.py index a39a95edb..7764d0191 100644 --- a/src/RelLib/_Repository.py +++ b/src/gen/lib/repo.py @@ -33,12 +33,12 @@ from types import InstanceType # GRAMPS modules # #------------------------------------------------------------------------- -from _PrimaryObject import PrimaryObject -from _NoteBase import NoteBase -from _AddressBase import AddressBase -from _UrlBase import UrlBase -from _RepositoryType import RepositoryType -from _MarkerType import MarkerType +from primaryobj import PrimaryObject +from notebase import NoteBase +from addressbase import AddressBase +from urlbase import UrlBase +from repotype import RepositoryType +from markertype import MarkerType #------------------------------------------------------------------------- # diff --git a/src/RelLib/_RepoRef.py b/src/gen/lib/reporef.py similarity index 94% rename from src/RelLib/_RepoRef.py rename to src/gen/lib/reporef.py index 9b4bbca54..4f46ebbbe 100644 --- a/src/RelLib/_RepoRef.py +++ b/src/gen/lib/reporef.py @@ -33,11 +33,11 @@ from types import InstanceType # GRAMPS modules # #------------------------------------------------------------------------- -from _SecondaryObject import SecondaryObject -from _PrivacyBase import PrivacyBase -from _NoteBase import NoteBase -from _RefBase import RefBase -from _SourceMediaType import SourceMediaType +from secondaryobj import SecondaryObject +from privacybase import PrivacyBase +from notebase import NoteBase +from refbase import RefBase +from srcmediatype import SourceMediaType #------------------------------------------------------------------------- # diff --git a/src/RelLib/_RepositoryType.py b/src/gen/lib/repotype.py similarity index 97% rename from src/RelLib/_RepositoryType.py rename to src/gen/lib/repotype.py index 8ea2e3509..1672e982e 100644 --- a/src/RelLib/_RepositoryType.py +++ b/src/gen/lib/repotype.py @@ -26,7 +26,7 @@ Respository types __revision__ = "$Revision$" -from _GrampsType import GrampsType, init_map +from grampstype import GrampsType, init_map from gettext import gettext as _ class RepositoryType(GrampsType): diff --git a/src/RelLib/_Researcher.py b/src/gen/lib/researcher.py similarity index 98% rename from src/RelLib/_Researcher.py rename to src/gen/lib/researcher.py index 5f33ff59b..81979afd9 100644 --- a/src/RelLib/_Researcher.py +++ b/src/gen/lib/researcher.py @@ -31,7 +31,7 @@ __revision__ = "$Revision$" # GRAMPS modules # #------------------------------------------------------------------------- -from _LocationBase import LocationBase +from locationbase import LocationBase #------------------------------------------------------------------------- # diff --git a/src/RelLib/_SecondaryObject.py b/src/gen/lib/secondaryobj.py similarity index 98% rename from src/RelLib/_SecondaryObject.py rename to src/gen/lib/secondaryobj.py index 3f0119d3d..ce3c11314 100644 --- a/src/RelLib/_SecondaryObject.py +++ b/src/gen/lib/secondaryobj.py @@ -31,7 +31,7 @@ __revision__ = "$Revision: $" # GRAMPS modules # #------------------------------------------------------------------------- -from _BaseObject import BaseObject +from baseobj import BaseObject #------------------------------------------------------------------------- # diff --git a/src/RelLib/_Source.py b/src/gen/lib/src.py similarity index 98% rename from src/RelLib/_Source.py rename to src/gen/lib/src.py index 9d1aa0c2e..1c15c6ca7 100644 --- a/src/RelLib/_Source.py +++ b/src/gen/lib/src.py @@ -33,11 +33,11 @@ from types import InstanceType # GRAMPS modules # #------------------------------------------------------------------------- -from _PrimaryObject import PrimaryObject -from _MediaBase import MediaBase -from _NoteBase import NoteBase -from _RepoRef import RepoRef -from _MarkerType import MarkerType +from primaryobj import PrimaryObject +from mediabase import MediaBase +from notebase import NoteBase +from reporef import RepoRef +from markertype import MarkerType #------------------------------------------------------------------------- # diff --git a/src/RelLib/_SourceBase.py b/src/gen/lib/srcbase.py similarity index 99% rename from src/RelLib/_SourceBase.py rename to src/gen/lib/srcbase.py index 5e72093df..26817d943 100644 --- a/src/RelLib/_SourceBase.py +++ b/src/gen/lib/srcbase.py @@ -33,7 +33,7 @@ from types import InstanceType # GRAMPS modules # #------------------------------------------------------------------------- -from _SourceRef import SourceRef +from srcref import SourceRef #------------------------------------------------------------------------- # diff --git a/src/RelLib/_SourceMediaType.py b/src/gen/lib/srcmediatype.py similarity index 98% rename from src/RelLib/_SourceMediaType.py rename to src/gen/lib/srcmediatype.py index 6d0873889..e33faa782 100644 --- a/src/RelLib/_SourceMediaType.py +++ b/src/gen/lib/srcmediatype.py @@ -25,7 +25,7 @@ SourceMedia types __revision__ = "$Revision$" -from _GrampsType import GrampsType, init_map +from grampstype import GrampsType, init_map from gettext import gettext as _ class SourceMediaType(GrampsType): diff --git a/src/RelLib/_SourceNote.py b/src/gen/lib/srcnote.py similarity index 100% rename from src/RelLib/_SourceNote.py rename to src/gen/lib/srcnote.py diff --git a/src/RelLib/_SourceRef.py b/src/gen/lib/srcref.py similarity index 95% rename from src/RelLib/_SourceRef.py rename to src/gen/lib/srcref.py index 596ea2d3c..40c1176f3 100644 --- a/src/RelLib/_SourceRef.py +++ b/src/gen/lib/srcref.py @@ -33,11 +33,11 @@ from warnings import warn # GRAMPS modules # #------------------------------------------------------------------------- -from _SecondaryObject import SecondaryObject -from _DateBase import DateBase -from _PrivacyBase import PrivacyBase -from _NoteBase import NoteBase -from _RefBase import RefBase +from secondaryobj import SecondaryObject +from datebase import DateBase +from privacybase import PrivacyBase +from notebase import NoteBase +from refbase import RefBase #------------------------------------------------------------------------- # diff --git a/src/RelLib/_Url.py b/src/gen/lib/url.py similarity index 96% rename from src/RelLib/_Url.py rename to src/gen/lib/url.py index ec3c5cba4..2d4ccbd27 100644 --- a/src/RelLib/_Url.py +++ b/src/gen/lib/url.py @@ -38,9 +38,9 @@ from warnings import warn # GRAMPS modules # #------------------------------------------------------------------------- -from _SecondaryObject import SecondaryObject -from _PrivacyBase import PrivacyBase -from _UrlType import UrlType +from secondaryobj import SecondaryObject +from privacybase import PrivacyBase +from urltype import UrlType #------------------------------------------------------------------------- # diff --git a/src/RelLib/_UrlBase.py b/src/gen/lib/urlbase.py similarity index 99% rename from src/RelLib/_UrlBase.py rename to src/gen/lib/urlbase.py index f791a36d0..28d749c62 100644 --- a/src/RelLib/_UrlBase.py +++ b/src/gen/lib/urlbase.py @@ -31,7 +31,7 @@ __revision__ = "$Revision$" # GRAMPS modules # #------------------------------------------------------------------------- -from _Url import Url +from url import Url #------------------------------------------------------------------------- # diff --git a/src/RelLib/_UrlType.py b/src/gen/lib/urltype.py similarity index 97% rename from src/RelLib/_UrlType.py rename to src/gen/lib/urltype.py index 8270aff96..c28fdf8fa 100644 --- a/src/RelLib/_UrlType.py +++ b/src/gen/lib/urltype.py @@ -26,7 +26,7 @@ URL types __revision__ = "$Revision$" -from _GrampsType import GrampsType, init_map +from grampstype import GrampsType, init_map from gettext import gettext as _ class UrlType(GrampsType): diff --git a/src/RelLib/_Witness.py b/src/gen/lib/witness.py similarity index 100% rename from src/RelLib/_Witness.py rename to src/gen/lib/witness.py diff --git a/src/gen/proxy/dbbase.py b/src/gen/proxy/dbbase.py index 7d4dc9b35..3709fa1ea 100644 --- a/src/gen/proxy/dbbase.py +++ b/src/gen/proxy/dbbase.py @@ -32,7 +32,7 @@ __revision__ = "$Revision: 8864 $" # GRAMPS libraries # #------------------------------------------------------------------------- -from RelLib import * +from gen.lib import * class DbBase: """ diff --git a/src/gen/proxy/filter.py b/src/gen/proxy/filter.py index 52fad5a5a..5130ba4ec 100644 --- a/src/gen/proxy/filter.py +++ b/src/gen/proxy/filter.py @@ -32,7 +32,7 @@ __revision__ = "$Revision: 8864 $" # GRAMPS libraries # #------------------------------------------------------------------------- -from RelLib import * +from gen.lib import * from proxybase import ProxyDbBase class FilterProxyDb(ProxyDbBase): diff --git a/src/gen/proxy/living.py b/src/gen/proxy/living.py index 5a38db7f5..2ccb3a902 100644 --- a/src/gen/proxy/living.py +++ b/src/gen/proxy/living.py @@ -33,7 +33,7 @@ __revision__ = "$Revision$" # #------------------------------------------------------------------------- from proxybase import ProxyDbBase -from RelLib import * +from gen.lib import * from Utils import probably_alive #------------------------------------------------------------------------- diff --git a/src/gen/proxy/private.py b/src/gen/proxy/private.py index 97bc34494..292fb2b76 100644 --- a/src/gen/proxy/private.py +++ b/src/gen/proxy/private.py @@ -32,7 +32,7 @@ __revision__ = "$Revision$" # GRAMPS libraries # #------------------------------------------------------------------------- -from RelLib import * +from gen.lib import * from proxybase import ProxyDbBase class PrivateProxyDb(ProxyDbBase): diff --git a/src/gen/utils/dbutils.py b/src/gen/utils/dbutils.py index 15177d03e..d19d2f515 100644 --- a/src/gen/utils/dbutils.py +++ b/src/gen/utils/dbutils.py @@ -23,7 +23,7 @@ from gettext import gettext as _ import copy -import RelLib +import gen.lib from BasicUtils import UpdateCallback @@ -168,17 +168,17 @@ def remove_child_from_family(db, person_handle, family_handle, trans=None): def marriage_from_eventref_list(db, eventref_list): for eventref in eventref_list: event = db.get_event_from_handle(eventref.ref) - if int(event.get_type()) == RelLib.EventType.MARRIAGE: + if int(event.get_type()) == gen.lib.EventType.MARRIAGE: return event else: return None def add_child_to_family(db, family, child, - mrel=RelLib.ChildRefType(), - frel=RelLib.ChildRefType(), + mrel=gen.lib.ChildRefType(), + frel=gen.lib.ChildRefType(), trans=None): - cref = RelLib.ChildRef() + cref = gen.lib.ChildRef() cref.ref = child.handle cref.set_father_relation(frel) cref.set_mother_relation(mrel) @@ -261,7 +261,7 @@ def db_copy(from_db,to_db,callback): item = cursor.first() while item: (handle,data) = item - exec('obj = RelLib.%s()' % table_name) + exec('obj = gen.lib.%s()' % table_name) obj.unserialize(data) add_func(obj,trans) item = cursor.next() @@ -295,12 +295,12 @@ def set_birth_death_index(db, person): for index in range(len(event_ref_list)): ref = event_ref_list[index] event = db.get_event_from_handle(ref.ref) - if (int(event.get_type()) == RelLib.EventType.BIRTH) \ - and (int(ref.get_role()) == RelLib.EventRoleType.PRIMARY) \ + if (int(event.get_type()) == gen.lib.EventType.BIRTH) \ + and (int(ref.get_role()) == gen.lib.EventRoleType.PRIMARY) \ and (birth_ref_index == -1): birth_ref_index = index - elif (int(event.get_type()) == RelLib.EventType.DEATH) \ - and (int(ref.get_role()) == RelLib.EventRoleType.PRIMARY) \ + elif (int(event.get_type()) == gen.lib.EventType.DEATH) \ + and (int(ref.get_role()) == gen.lib.EventRoleType.PRIMARY) \ and (death_ref_index == -1): death_ref_index = index diff --git a/src/plugins/AncestorReport.py b/src/plugins/AncestorReport.py index 767c29352..3a67c48ca 100644 --- a/src/plugins/AncestorReport.py +++ b/src/plugins/AncestorReport.py @@ -43,7 +43,7 @@ from ReportBase import Report, ReportUtils, ReportOptions, \ import BaseDoc from BasicUtils import name_displayer -from RelLib import ChildRefType +from gen.lib import ChildRefType #------------------------------------------------------------------------ # diff --git a/src/plugins/Ancestors.py b/src/plugins/Ancestors.py index 1a8abdbe4..40e6be0bb 100644 --- a/src/plugins/Ancestors.py +++ b/src/plugins/Ancestors.py @@ -47,7 +47,7 @@ from ReportBase import Report, ReportUtils, ReportOptions, \ CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI import BaseDoc -import RelLib +import gen.lib from DateHandler import displayer as _dd from BasicUtils import name_displayer as _nd @@ -601,12 +601,12 @@ class ComprehensiveAncestorsReport (Report): return t gender = person.get_gender () - if gender == RelLib.Person.FEMALE: + if gender == gen.lib.Person.FEMALE: if name.get_type () == 'Married Name': return _('Mrs.') return _('Miss') - elif gender == RelLib.Person.MALE: + elif gender == gen.lib.Person.MALE: return _('Mr.') else: return _('(gender unknown)') @@ -727,7 +727,7 @@ class ComprehensiveAncestorsReport (Report): break if not first_rel: - if gender == RelLib.Person.FEMALE: + if gender == gen.lib.Person.FEMALE: ret += _(' She later married %(name)s') % \ {'name': self.person_name (spouse_handle)} else: @@ -737,7 +737,7 @@ class ComprehensiveAncestorsReport (Report): elif (listing_children or spouse == mother or family != from_family): - if gender == RelLib.Person.FEMALE: + if gender == gen.lib.Person.FEMALE: ret += _(' She married %(name)s') % \ {'name': self.person_name (spouse_handle)} else: @@ -748,14 +748,14 @@ class ComprehensiveAncestorsReport (Report): ret += self.event_info (marriage) else: # Not a marriage if not first_rel: - if gender == RelLib.Person.FEMALE: + if gender == gen.lib.Person.FEMALE: ret += _(' She later had a relationship with %(name)s') % \ {'name': self.person_name (spouse_handle)} else: ret += _(' He later had a relationship with %(name)s') % \ {'name': self.person_name (spouse_handle)} else: - if gender == RelLib.Person.FEMALE: + if gender == gen.lib.Person.FEMALE: ret += _(' She had a relationship with %(name)s') % \ {'name': self.person_name (spouse_handle)} else: diff --git a/src/plugins/BookReport.py b/src/plugins/BookReport.py index 63f047eda..48b3f4c33 100644 --- a/src/plugins/BookReport.py +++ b/src/plugins/BookReport.py @@ -63,7 +63,7 @@ import gtk.glade # gramps modules # #------------------------------------------------------------------------- -from RelLib import Person +from gen.lib import Person import const import Utils import ListModel diff --git a/src/plugins/Calendar.py b/src/plugins/Calendar.py index 1e4027384..0bdfedde5 100644 --- a/src/plugins/Calendar.py +++ b/src/plugins/Calendar.py @@ -44,7 +44,7 @@ from ReportBase import Report, ReportUtils, ReportOptions, \ FilterListOption, \ CATEGORY_DRAW, CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI import GrampsLocale -import RelLib +import gen.lib from Utils import probably_alive, ProgressMeter from FontScale import string_trim, string_width pt2cm = ReportUtils.pt2cm @@ -84,7 +84,7 @@ class Calendar(Report): married_name = None names = [primary_name] + person.get_alternate_names() for n in names: - if int(n.get_type()) == RelLib.NameType.MARRIED: + if int(n.get_type()) == gen.lib.NameType.MARRIED: married_name = n # Now, decide which to use: if maiden_name != None: @@ -265,7 +265,7 @@ class Calendar(Report): # add some things to handle maiden name: father_lastname = None # husband, actually if self.maiden_name == 0: # get husband's last name: - if person.get_gender() == RelLib.Person.FEMALE: + if person.get_gender() == gen.lib.Person.FEMALE: family_list = person.get_family_handle_list() if len(family_list) > 0: fhandle = family_list[0] # first is primary diff --git a/src/plugins/ChangeTypes.py b/src/plugins/ChangeTypes.py index d03683fc1..be75c2d25 100644 --- a/src/plugins/ChangeTypes.py +++ b/src/plugins/ChangeTypes.py @@ -48,7 +48,7 @@ import Utils import locale import ManagedWindow import AutoComp -from RelLib import EventType +from gen.lib import EventType from QuestionDialog import OkDialog from PluginUtils import Tool, register_tool diff --git a/src/plugins/Check.py b/src/plugins/Check.py index 9a36bea87..5225a5658 100644 --- a/src/plugins/Check.py +++ b/src/plugins/Check.py @@ -54,7 +54,7 @@ import gtk.glade # GRAMPS modules # #------------------------------------------------------------------------- -import RelLib +import gen.lib import Utils import const import ManagedWindow @@ -262,10 +262,10 @@ class CheckIntegrity: p_changed = False name = person.get_primary_name() if name.get_sort_as() in deleted_name_formats: - name.set_sort_as(RelLib.Name.DEF) + name.set_sort_as(gen.lib.Name.DEF) p_changed = True if name.get_display_as() in deleted_name_formats: - name.set_display_as(RelLib.Name.DEF) + name.set_display_as(gen.lib.Name.DEF) p_changed = True if p_changed: person.set_primary_name(name) @@ -274,10 +274,10 @@ class CheckIntegrity: name_list = [] for name in person.get_alternate_names(): if name.get_sort_as() in deleted_name_formats: - name.set_sort_as(RelLib.Name.DEF) + name.set_sort_as(gen.lib.Name.DEF) a_changed = True if name.get_display_as() in deleted_name_formats: - name.set_display_as(RelLib.Name.DEF) + name.set_display_as(gen.lib.Name.DEF) a_changed = True name_list.append(name) if a_changed: @@ -302,7 +302,7 @@ class CheckIntegrity: for handle in self.db.person_map.keys(): value = self.db.person_map[handle] - p = RelLib.Person(value) + p = gen.lib.Person(value) splist = p.get_family_handle_list() if len(splist) != len(set(splist)): new_list = [] @@ -571,14 +571,14 @@ class CheckIntegrity: CHANGE_REPOS = 7 CHANGE_NOTE = 5 - empty_person_data = RelLib.Person().serialize() - empty_family_data = RelLib.Family().serialize() - empty_event_data = RelLib.Event().serialize() - empty_source_data = RelLib.Source().serialize() - empty_place_data = RelLib.Place().serialize() - empty_media_data = RelLib.MediaObject().serialize() - empty_repos_data = RelLib.Repository().serialize() - empty_note_data = RelLib.Note().serialize() + empty_person_data = gen.lib.Person().serialize() + empty_family_data = gen.lib.Family().serialize() + empty_event_data = gen.lib.Event().serialize() + empty_source_data = gen.lib.Source().serialize() + empty_place_data = gen.lib.Place().serialize() + empty_media_data = gen.lib.MediaObject().serialize() + empty_repos_data = gen.lib.Repository().serialize() + empty_note_data = gen.lib.Note().serialize() tables = { 'persons' : {'get_func': self.db.get_person_from_handle, @@ -730,8 +730,8 @@ class CheckIntegrity: else: mgender = None - if (fgender == RelLib.Person.FEMALE \ - or mgender == RelLib.Person.MALE) \ + if (fgender == gen.lib.Person.FEMALE \ + or mgender == gen.lib.Person.MALE) \ and fgender != mgender: # swap. note: (at most) one handle may be None family.set_father_handle(mother_handle) @@ -759,9 +759,9 @@ class CheckIntegrity: self.db.commit_person(person,self.trans) self.invalid_events.append(key) else: - if int(birth.get_type()) != RelLib.EventType.BIRTH: + if int(birth.get_type()) != gen.lib.EventType.BIRTH: # Birth event was not of the type "Birth" - birth.set_type(RelLib.EventType(RelLib.EventType.BIRTH)) + birth.set_type(gen.lib.EventType(gen.lib.EventType.BIRTH)) self.db.commit_event(birth,self.trans) self.invalid_birth_events.append(key) death_ref = person.get_death_ref() @@ -775,9 +775,9 @@ class CheckIntegrity: self.db.commit_person(person,self.trans) self.invalid_events.append(key) else: - if int(death.get_type()) != RelLib.EventType.DEATH: + if int(death.get_type()) != gen.lib.EventType.DEATH: # Death event was not of the type "Death" - death.set_type(RelLib.EventType(RelLib.EventType.DEATH)) + death.set_type(gen.lib.EventType(gen.lib.EventType.DEATH)) self.db.commit_event(death,self.trans) self.invalid_death_events.append(key) @@ -908,7 +908,7 @@ class CheckIntegrity: for handle in self.db.person_map.keys(): self.progress.step() info = self.db.person_map[handle] - person = RelLib.Person() + person = gen.lib.Person() person.unserialize(info) handle_list = person.get_referenced_handles_recursively() bad_handles = [ item[1] for item in handle_list @@ -924,7 +924,7 @@ class CheckIntegrity: for handle in self.db.family_map.keys(): self.progress.step() info = self.db.family_map[handle] - family = RelLib.Family() + family = gen.lib.Family() family.unserialize(info) handle_list = family.get_referenced_handles_recursively() bad_handles = [ item[1] for item in handle_list @@ -940,7 +940,7 @@ class CheckIntegrity: for handle in self.db.place_map.keys(): self.progress.step() info = self.db.place_map[handle] - place = RelLib.Place() + place = gen.lib.Place() place.unserialize(info) handle_list = place.get_referenced_handles_recursively() bad_handles = [ item[1] for item in handle_list @@ -957,7 +957,7 @@ class CheckIntegrity: for handle in known_handles: self.progress.step() info = self.db.source_map[handle] - source = RelLib.Source() + source = gen.lib.Source() source.unserialize(info) handle_list = source.get_referenced_handles_recursively() bad_handles = [ item[1] for item in handle_list @@ -973,7 +973,7 @@ class CheckIntegrity: for handle in self.db.media_map.keys(): self.progress.step() info = self.db.media_map[handle] - obj = RelLib.MediaObject() + obj = gen.lib.MediaObject() obj.unserialize(info) handle_list = obj.get_referenced_handles_recursively() bad_handles = [ item[1] for item in handle_list @@ -989,7 +989,7 @@ class CheckIntegrity: for handle in self.db.event_map.keys(): self.progress.step() info = self.db.event_map[handle] - event = RelLib.Event() + event = gen.lib.Event() event.unserialize(info) handle_list = event.get_referenced_handles_recursively() bad_handles = [ item[1] for item in handle_list @@ -1015,7 +1015,7 @@ class CheckIntegrity: for handle in self.db.person_map.keys(): self.progress.step() info = self.db.person_map[handle] - person = RelLib.Person() + person = gen.lib.Person() person.unserialize(info) handle_list = person.get_referenced_handles_recursively() bad_handles = [ item[1] for item in handle_list @@ -1031,7 +1031,7 @@ class CheckIntegrity: for handle in self.db.family_map.keys(): self.progress.step() info = self.db.family_map[handle] - family = RelLib.Family() + family = gen.lib.Family() family.unserialize(info) handle_list = family.get_referenced_handles_recursively() bad_handles = [ item[1] for item in handle_list @@ -1047,7 +1047,7 @@ class CheckIntegrity: for handle in self.db.place_map.keys(): self.progress.step() info = self.db.place_map[handle] - place = RelLib.Place() + place = gen.lib.Place() place.unserialize(info) handle_list = place.get_referenced_handles_recursively() bad_handles = [ item[1] for item in handle_list @@ -1063,7 +1063,7 @@ class CheckIntegrity: for handle in self.db.event_map.keys(): self.progress.step() info = self.db.event_map[handle] - event = RelLib.Event() + event = gen.lib.Event() event.unserialize(info) handle_list = event.get_referenced_handles_recursively() bad_handles = [ item[1] for item in handle_list @@ -1079,7 +1079,7 @@ class CheckIntegrity: for handle in self.db.source_map.keys(): self.progress.step() info = self.db.source_map[handle] - source = RelLib.Source() + source = gen.lib.Source() source.unserialize(info) handle_list = source.get_referenced_handles_recursively() bad_handles = [ item[1] for item in handle_list diff --git a/src/plugins/DetAncestralReport.py b/src/plugins/DetAncestralReport.py index 22fcf45fd..a6e8f36b6 100644 --- a/src/plugins/DetAncestralReport.py +++ b/src/plugins/DetAncestralReport.py @@ -43,7 +43,7 @@ import gtk # GRAMPS modules # #------------------------------------------------------------------------ -import RelLib +import gen.lib from PluginUtils import register_report from ReportBase import Report, ReportUtils, ReportOptions, \ CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI @@ -184,7 +184,7 @@ class DetAncestorReport(Report): family = self.database.get_family_from_handle(family_handle) mother_handle = family.get_mother_handle() if mother_handle == None or \ - person.get_gender() == RelLib.Person.FEMALE: + person.get_gender() == gen.lib.Person.FEMALE: if self.listChildren: self.write_children(family) if self.includeEvents: @@ -544,7 +544,7 @@ class DetAncestorReport(Report): ind_handle = None has_info = False person_key = "" - if mate.get_gender() == RelLib.Person.MALE: + if mate.get_gender() == gen.lib.Person.MALE: ind_handle = family.get_mother_handle() else: ind_handle = family.get_father_handle() @@ -558,9 +558,9 @@ class DetAncestorReport(Report): event = self.database.get_event_from_handle(event_ref.ref) if event: etype = event.get_type() - if etype == RelLib.EventType.BURIAL or \ - etype == RelLib.EventType.BIRTH or \ - etype == RelLib.EventType.DEATH : + if etype == gen.lib.EventType.BURIAL or \ + etype == gen.lib.EventType.BIRTH or \ + etype == gen.lib.EventType.DEATH : has_info = True break if not has_info: @@ -604,7 +604,7 @@ class DetAncestorReport(Report): self.doc.end_paragraph() - if person_name and mate.get_gender()==RelLib.Person.MALE: + if person_name and mate.get_gender()==gen.lib.Person.MALE: if self.listChildren: self.write_children(family) if self.includeEvents: diff --git a/src/plugins/DetDescendantReport.py b/src/plugins/DetDescendantReport.py index ff7b76d4f..30c4b34ff 100644 --- a/src/plugins/DetDescendantReport.py +++ b/src/plugins/DetDescendantReport.py @@ -44,7 +44,7 @@ import gtk # GRAMPS modules # #------------------------------------------------------------------------ -import RelLib +import gen.lib import Utils import Errors from PluginUtils import register_report @@ -170,7 +170,7 @@ class DetDescendantReport(Report): nspouses = 0 for family_handle in self.start_person.get_family_handle_list(): family = self.database.get_family_from_handle(family_handle) - if self.start_person.get_gender() == RelLib.Person.MALE: + if self.start_person.get_gender() == gen.lib.Person.MALE: spouse_handle = family.get_mother_handle() else: spouse_handle = family.get_father_handle() @@ -254,7 +254,7 @@ class DetDescendantReport(Report): for family_handle in person.get_family_handle_list(): family = self.database.get_family_from_handle(family_handle) if self.includeMates: - if person.get_gender() == RelLib.Person.MALE: + if person.get_gender() == gen.lib.Person.MALE: mate_handle = family.get_mother_handle() else: mate_handle = family.get_father_handle() diff --git a/src/plugins/EventNames.py b/src/plugins/EventNames.py index 6fa94e382..724f15992 100644 --- a/src/plugins/EventNames.py +++ b/src/plugins/EventNames.py @@ -43,7 +43,7 @@ import gtk.glade # #------------------------------------------------------------------------- import ManagedWindow -import RelLib +import gen.lib import Utils from PluginUtils import Tool, register_tool @@ -82,7 +82,7 @@ class EventNames(Tool.BatchTool, ManagedWindow.ManagedWindow): for handle in self.db.get_person_handles(): person = self.db.get_person_from_handle(handle) for event_ref in person.get_event_ref_list(): - if event_ref.get_role() == RelLib.EventRoleType.PRIMARY: + if event_ref.get_role() == gen.lib.EventRoleType.PRIMARY: event_handle = event_ref.ref event = self.db.get_event_from_handle(event_handle) if event.get_description() == "": @@ -93,7 +93,7 @@ class EventNames(Tool.BatchTool, ManagedWindow.ManagedWindow): for handle in self.db.get_family_handles(): family = self.db.get_family_from_handle(handle) for event_ref in family.get_event_ref_list(): - if event_ref.get_role() == RelLib.EventRoleType.FAMILY: + if event_ref.get_role() == gen.lib.EventRoleType.FAMILY: event_handle = event_ref.ref event = self.db.get_event_from_handle(event_handle) if event.get_description() == "": diff --git a/src/plugins/ExportCSV.py b/src/plugins/ExportCSV.py index 87792967a..1cb785196 100644 --- a/src/plugins/ExportCSV.py +++ b/src/plugins/ExportCSV.py @@ -54,7 +54,7 @@ log = logging.getLogger(".ExportCSV") # GRAMPS modules # #------------------------------------------------------------------------- -import RelLib +import gen.lib from Filters import GenericFilter, Rules, build_filter_menu import const import Utils @@ -384,12 +384,12 @@ class CSVWriter: note = '' # don't export notes or source callname = primary_name.get_call_name() gender = person.get_gender() - if gender == RelLib.Person.MALE: - gender = Utils.gender[RelLib.Person.MALE] - elif gender == RelLib.Person.FEMALE: - gender = Utils.gender[RelLib.Person.FEMALE] + if gender == gen.lib.Person.MALE: + gender = Utils.gender[gen.lib.Person.MALE] + elif gender == gen.lib.Person.FEMALE: + gender = Utils.gender[gen.lib.Person.FEMALE] else: - gender = Utils.gender[RelLib.Person.UNKNOWN] + gender = Utils.gender[gen.lib.Person.UNKNOWN] # Birth: birthdate = "" birthplace = "" @@ -459,7 +459,7 @@ class CSVWriter: event_ref_list = family.get_event_ref_list() for event_ref in event_ref_list: event = self.db.get_event_from_handle(event_ref.ref) - if event.get_type() == RelLib.EventType.MARRIAGE: + if event.get_type() == gen.lib.EventType.MARRIAGE: mdate = self.format_date( event) place_handle = event.get_place_handle() if place_handle: diff --git a/src/plugins/ExportVCalendar.py b/src/plugins/ExportVCalendar.py index 442a5af6c..fbdf5c7ed 100644 --- a/src/plugins/ExportVCalendar.py +++ b/src/plugins/ExportVCalendar.py @@ -55,7 +55,7 @@ log = logging.getLogger(".ExportVCal") from Filters import GenericFilter, Rules, build_filter_menu import const import Utils -from RelLib import Date, EventType +from gen.lib import Date, EventType import Errors from QuestionDialog import ErrorDialog from PluginUtils import register_export diff --git a/src/plugins/ExportVCard.py b/src/plugins/ExportVCard.py index c71ecb595..f14c603b0 100644 --- a/src/plugins/ExportVCard.py +++ b/src/plugins/ExportVCard.py @@ -53,7 +53,7 @@ import gtk.glade #------------------------------------------------------------------------- from Filters import GenericFilter, Rules, build_filter_menu import const -from RelLib import Date +from gen.lib import Date import Errors from QuestionDialog import ErrorDialog from PluginUtils import register_export diff --git a/src/plugins/FamilyGroup.py b/src/plugins/FamilyGroup.py index dc1d2a8e9..fd0ee7605 100644 --- a/src/plugins/FamilyGroup.py +++ b/src/plugins/FamilyGroup.py @@ -35,7 +35,7 @@ import gtk # GRAMPS # #------------------------------------------------------------------------ -import RelLib +import gen.lib from PluginUtils import register_report from ReportBase import Report, ReportUtils, ReportOptions, \ CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI @@ -241,7 +241,7 @@ class FamilyGroup(Report): if not person_handle and not self.missingInfo: return elif not person_handle: - person = RelLib.Person() + person = gen.lib.Person() else: person = self.database.get_person_from_handle(person_handle) name = _nd.display(person) @@ -259,7 +259,7 @@ class FamilyGroup(Report): birth_ref = person.get_birth_ref() birth = None - evtName = str(RelLib.EventType()) + evtName = str(gen.lib.EventType()) if birth_ref: birth = self.database.get_event_from_handle(birth_ref.ref) if birth or self.missingInfo: @@ -267,7 +267,7 @@ class FamilyGroup(Report): death_ref = person.get_death_ref() death = None - evtName = str(RelLib.EventType(RelLib.EventType.DEATH)) + evtName = str(gen.lib.EventType(gen.lib.EventType.DEATH)) if death_ref: death = self.database.get_event_from_handle(death_ref.ref) if death or self.missingInfo: @@ -332,7 +332,7 @@ class FamilyGroup(Report): for event_ref in family_ref_list: if event_ref: event = self.database.get_event_from_handle(event_ref.ref) - if int(event.get_type()) == RelLib.EventType.MARRIAGE: + if int(event.get_type()) == gen.lib.EventType.MARRIAGE: m = event break @@ -346,14 +346,14 @@ class FamilyGroup(Report): self.doc.end_cell() self.doc.end_row() - evtName = str(RelLib.EventType(RelLib.EventType.MARRIAGE)) + evtName = str(gen.lib.EventType(gen.lib.EventType.MARRIAGE)) self.dump_parent_event(evtName,m) for event_ref in family_ref_list: if event_ref: event = self.database.get_event_from_handle(event_ref.ref) evtType = event.get_type() - if int(evtType) != RelLib.EventType.MARRIAGE: + if int(evtType) != gen.lib.EventType.MARRIAGE: name = Utils.format_event( evtType ) self.dump_parent_event(name,event) @@ -369,7 +369,7 @@ class FamilyGroup(Report): for event_ref in family_list: if event_ref: event = self.database.get_event_from_handle(event_ref.ref) - if event.get_type() == RelLib.EventType.MARRIAGE: + if event.get_type() == gen.lib.EventType.MARRIAGE: m = event break @@ -388,7 +388,7 @@ class FamilyGroup(Report): for event_ref in family_list: if event_ref: event = self.database.get_event_from_handle(event_ref.ref) - if event.get_type() != RelLib.EventType.MARRIAGE: + if event.get_type() != gen.lib.EventType.MARRIAGE: self.dump_parent_event(str(event.get_type()),event) self.doc.end_table() @@ -458,9 +458,9 @@ class FamilyGroup(Report): self.doc.start_cell('FGR-TextChild2') self.doc.start_paragraph('FGR-ChildText') index_str = ("%d" % index) - if person.get_gender() == RelLib.Person.MALE: + if person.get_gender() == gen.lib.Person.MALE: self.doc.write_text(index_str + _("acronym for male|M")) - elif person.get_gender() == RelLib.Person.FEMALE: + elif person.get_gender() == gen.lib.Person.FEMALE: self.doc.write_text(index_str + _("acronym for female|F")) else: self.doc.write_text(_("%dU") % index) @@ -498,7 +498,7 @@ class FamilyGroup(Report): for event_ref in family.get_event_ref_list(): if event_ref: event = self.database.get_event_from_handle(event_ref.ref) - if int(event.get_type()) == RelLib.EventType.MARRIAGE: + if int(event.get_type()) == gen.lib.EventType.MARRIAGE: m = event break @@ -548,7 +548,7 @@ class FamilyGroup(Report): self.doc.end_row() if m: - evtName = str(RelLib.EventType(RelLib.EventType.MARRIAGE)) + evtName = str(gen.lib.EventType(gen.lib.EventType.MARRIAGE)) if index == families: self.dump_child_event('FGR-TextChild2',evtName,m) else: diff --git a/src/plugins/FamilyLines.py b/src/plugins/FamilyLines.py index d3f67863f..df0f201b1 100644 --- a/src/plugins/FamilyLines.py +++ b/src/plugins/FamilyLines.py @@ -54,7 +54,7 @@ import gobject # GRAMPS module # #------------------------------------------------------------------------ -import RelLib +import gen.lib import Config import Errors import Utils @@ -509,9 +509,9 @@ class FamilyLinesReport(Report): # figure out what colour to use colour = self.colourUnknown - if person.get_gender() == RelLib.Person.MALE: + if person.get_gender() == gen.lib.Person.MALE: colour = self.colourMales - if person.get_gender() == RelLib.Person.FEMALE: + if person.get_gender() == gen.lib.Person.FEMALE: colour = self.colourFemales # see if we have surname colours that match this person @@ -640,7 +640,7 @@ class FamilyLinesReport(Report): if self.includeDates or self.includePlaces: for event_ref in family.get_event_ref_list(): event = self.db.get_event_from_handle(event_ref.ref) - if event.get_type() == RelLib.EventType.MARRIAGE: + if event.get_type() == gen.lib.EventType.MARRIAGE: # get the wedding date if (event.private and self.includePrivate) or not event.private: if self.includeDates: diff --git a/src/plugins/FindDupes.py b/src/plugins/FindDupes.py index d58ca58ad..063d49bc8 100644 --- a/src/plugins/FindDupes.py +++ b/src/plugins/FindDupes.py @@ -43,7 +43,7 @@ import gtk.glade # GRAMPS modules # #------------------------------------------------------------------------- -import RelLib +import gen.lib import Utils import soundex from BasicUtils import name_displayer @@ -203,7 +203,7 @@ class Merge(Tool.Tool,ManagedWindow.ManagedWindow): self.progress.step() p1 = self.db.get_person_from_handle(p1_id) key = self.gen_key(p1.get_primary_name().get_surname()) - if p1.get_gender() == RelLib.Person.MALE: + if p1.get_gender() == gen.lib.Person.MALE: if males.has_key(key): males[key].append(p1_id) else: @@ -222,7 +222,7 @@ class Merge(Tool.Tool,ManagedWindow.ManagedWindow): p1 = self.db.get_person_from_handle(p1key) key = self.gen_key(p1.get_primary_name().get_surname()) - if p1.get_gender() == RelLib.Person.MALE: + if p1.get_gender() == gen.lib.Person.MALE: remaining = males[key] else: remaining = females[key] @@ -274,25 +274,25 @@ class Merge(Tool.Tool,ManagedWindow.ManagedWindow): if birth1_ref: birth1 = self.db.get_event_from_handle(birth1_ref.ref) else: - birth1 = RelLib.Event() + birth1 = gen.lib.Event() death1_ref = p1.get_death_ref() if death1_ref: death1 = self.db.get_event_from_handle(death1_ref.ref) else: - death1 = RelLib.Event() + death1 = gen.lib.Event() birth2_ref = p2.get_birth_ref() if birth2_ref: birth2 = self.db.get_event_from_handle(birth2_ref.ref) else: - birth2 = RelLib.Event() + birth2 = gen.lib.Event() death2_ref = p2.get_death_ref() if death2_ref: death2 = self.db.get_event_from_handle(death2_ref.ref) else: - death2 = RelLib.Event() + death2 = gen.lib.Event() value = self.date_match(birth1.get_date_object(), birth2.get_date_object()) @@ -373,7 +373,7 @@ class Merge(Tool.Tool,ManagedWindow.ManagedWindow): f1 = self.db.get_family_from_handle(f1_id) for f2_id in p2.get_family_handle_list(): f2 = self.db.get_family_from_handle(f2_id) - if p1.get_gender() == RelLib.Person.FEMALE: + if p1.get_gender() == gen.lib.Person.FEMALE: father1_id = f1.get_father_handle() father2_id = f2.get_father_handle() if father1_id and father2_id: diff --git a/src/plugins/FtmStyleAncestors.py b/src/plugins/FtmStyleAncestors.py index 97bde975a..11a3ddd5c 100644 --- a/src/plugins/FtmStyleAncestors.py +++ b/src/plugins/FtmStyleAncestors.py @@ -35,7 +35,7 @@ from gettext import gettext as _ # #------------------------------------------------------------------------ import BaseDoc -import RelLib +import gen.lib import DateHandler import const from PluginUtils import register_report diff --git a/src/plugins/FtmStyleDescendants.py b/src/plugins/FtmStyleDescendants.py index b1e0a627f..799ce37e0 100644 --- a/src/plugins/FtmStyleDescendants.py +++ b/src/plugins/FtmStyleDescendants.py @@ -41,7 +41,7 @@ from PluginUtils import register_report from ReportBase import Report, ReportUtils, ReportOptions, \ CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI import BaseDoc -import RelLib +import gen.lib import DateHandler import const diff --git a/src/plugins/GraphViz.py b/src/plugins/GraphViz.py index 3b5438c43..732d44da5 100644 --- a/src/plugins/GraphViz.py +++ b/src/plugins/GraphViz.py @@ -62,7 +62,7 @@ from ReportBase import Report, ReportUtils, ReportOptions, \ from ReportBase._ReportDialog import ReportDialog from ReportBase._CommandLineReport import CommandLineReport from Filters import GenericFilter, Rules -import RelLib +import gen.lib import DateHandler from BasicUtils import name_displayer import const @@ -432,8 +432,8 @@ just use iconv: def get_family_link(self, p_id, family, frel, mrel): "returns string of GraphViz edge linking child to family" style = '' - adopted = ((int(frel) != RelLib.ChildRefType.BIRTH) or - (int(mrel) != RelLib.ChildRefType.BIRTH)) + adopted = ((int(frel) != gen.lib.ChildRefType.BIRTH) or + (int(mrel) != gen.lib.ChildRefType.BIRTH)) if adopted and self.adoptionsdashed: style = 'style=dotted' return '"p%s" -> "f%s" [%s];\n' % (p_id, @@ -442,7 +442,7 @@ just use iconv: def get_parent_link(self, p_id, parent_handle, rel): "returns string of GraphViz edge linking child to parent" style = '' - if (int(rel) != RelLib.ChildRefType.BIRTH) and self.adoptionsdashed: + if (int(rel) != gen.lib.ChildRefType.BIRTH) and self.adoptionsdashed: style = 'style=dotted' parent = self.database.get_person_from_handle(parent_handle) return '"p%s" -> "p%s" [%s];\n' % (p_id, parent.get_gramps_id(), style) @@ -492,7 +492,7 @@ just use iconv: for event_ref in fam.get_event_ref_list(): event = self.database.get_event_from_handle( event_ref.ref) - if int(event.get_type()) == RelLib.EventType.MARRIAGE: + if int(event.get_type()) == gen.lib.EventType.MARRIAGE: label = self.get_event_string(event) break if self.includeid: @@ -603,10 +603,10 @@ just use iconv: # missing info, use (first) christening/burial instead for event_ref in person.get_primary_event_ref_list(): event = self.database.get_event_from_handle(event_ref.ref) - if int(event.get_type()) == RelLib.EventType.CHRISTEN: + if int(event.get_type()) == gen.lib.EventType.CHRISTEN: if not birth: birth = self.get_event_string(event) - elif int(event.get_type()) == RelLib.EventType.BURIAL: + elif int(event.get_type()) == gen.lib.EventType.BURIAL: if not death: death = self.get_event_string(event) return (birth, death) diff --git a/src/plugins/ImportCSV.py b/src/plugins/ImportCSV.py index cb2a55465..70c7679ee 100644 --- a/src/plugins/ImportCSV.py +++ b/src/plugins/ImportCSV.py @@ -55,7 +55,7 @@ import gtk # #------------------------------------------------------------------------- import Errors -import RelLib +import gen.lib import const from QuestionDialog import ErrorDialog from DateHandler import parser as _dp @@ -299,13 +299,13 @@ class CSVParser: # adjust gender, if not already provided if husband: # this is just a guess, if unknown - if husband.get_gender() == RelLib.Person.UNKNOWN: - husband.set_gender(RelLib.Person.MALE) + if husband.get_gender() == gen.lib.Person.UNKNOWN: + husband.set_gender(gen.lib.Person.MALE) self.db.commit_person(husband, self.trans) if wife: # this is just a guess, if unknown - if wife.get_gender() == RelLib.Person.UNKNOWN: - wife.set_gender(RelLib.Person.FEMALE) + if wife.get_gender() == gen.lib.Person.UNKNOWN: + wife.set_gender(gen.lib.Person.FEMALE) self.db.commit_person(wife, self.trans) if marriage_ref: self.storeup("family", marriage_ref.lower(), family) @@ -319,9 +319,9 @@ class CSVParser: marriagedate = _dp.parse(marriagedate) if marriagedate or marriageplace or marriagesource: # add, if new; replace, if different - new, marriage = self.get_or_create_event(family, RelLib.EventType.MARRIAGE, marriagedate, marriageplace, marriagesource) + new, marriage = self.get_or_create_event(family, gen.lib.EventType.MARRIAGE, marriagedate, marriageplace, marriagesource) if new: - mar_ref = RelLib.EventRef() + mar_ref = gen.lib.EventRef() mar_ref.set_reference_handle(marriage.get_handle()) family.add_event_ref(mar_ref) self.db.commit_family(family, self.trans) @@ -358,7 +358,7 @@ class CSVParser: if child.get_handle() not in [ref.ref for ref in family.get_child_ref_list()]: # add child to family if self.debug: print " adding child to family", child.get_gramps_id(), family.get_gramps_id() - childref = RelLib.ChildRef() + childref = gen.lib.ChildRef() childref.set_reference_handle(child.get_handle()) family.add_child_ref( childref) self.db.commit_family(family, self.trans) @@ -366,12 +366,12 @@ class CSVParser: if gender: # replace gender = gender.lower() - if gender == gender_map[RelLib.Person.MALE]: - gender = RelLib.Person.MALE - elif gender == gender_map[RelLib.Person.FEMALE]: - gender = RelLib.Person.FEMALE + if gender == gender_map[gen.lib.Person.MALE]: + gender = gen.lib.Person.MALE + elif gender == gender_map[gen.lib.Person.FEMALE]: + gender = gen.lib.Person.FEMALE else: - gender = RelLib.Person.UNKNOWN + gender = gen.lib.Person.UNKNOWN child.set_gender(gender) if source: # add, if new @@ -383,7 +383,7 @@ class CSVParser: if ref.ref == source.get_handle(): found = 1 if not found: - sref = RelLib.SourceRef() + sref = gen.lib.SourceRef() sref.set_reference_handle(source.get_handle()) child.add_source_reference(sref) # put note on child @@ -425,8 +425,8 @@ class CSVParser: continue # need a name if it is a new person # new person person = self.create_person(firstname, surname) - name = RelLib.Name() - name.set_type( RelLib.NameType(RelLib.NameType.BIRTH)) + name = gen.lib.Name() + name.set_type( gen.lib.NameType(gen.lib.NameType.BIRTH)) name.set_first_name(firstname) name.set_surname(surname) person.set_primary_name(name) @@ -457,14 +457,14 @@ class CSVParser: elif person_ref != None: if person_ref.startswith("[") and person_ref.endswith("]"): person.gramps_id = person_ref[1:-1] - if person.get_gender() == RelLib.Person.UNKNOWN and gender != None: + if person.get_gender() == gen.lib.Person.UNKNOWN and gender != None: gender = gender.lower() - if gender == gender_map[RelLib.Person.MALE]: - gender = RelLib.Person.MALE - elif gender == gender_map[RelLib.Person.FEMALE]: - gender = RelLib.Person.FEMALE + if gender == gender_map[gen.lib.Person.MALE]: + gender = gen.lib.Person.MALE + elif gender == gender_map[gen.lib.Person.FEMALE]: + gender = gen.lib.Person.FEMALE else: - gender = RelLib.Person.UNKNOWN + gender = gen.lib.Person.UNKNOWN person.set_gender(gender) ######################################################### # add if new, replace if different @@ -475,11 +475,11 @@ class CSVParser: if birthsource != None: new, birthsource = self.get_or_create_source(birthsource) if birthdate or birthplace or birthsource: - new, birth = self.get_or_create_event(person, RelLib.EventType.BIRTH, birthdate, birthplace, birthsource) + new, birth = self.get_or_create_event(person, gen.lib.EventType.BIRTH, birthdate, birthplace, birthsource) birth_ref = person.get_birth_ref() if birth_ref == None: # new - birth_ref = RelLib.EventRef() + birth_ref = gen.lib.EventRef() birth_ref.set_reference_handle( birth.get_handle()) person.set_birth_ref( birth_ref) if deathdate != None: @@ -489,14 +489,14 @@ class CSVParser: if deathsource != None: new, deathsource = self.get_or_create_source(deathsource) if deathdate or deathplace or deathsource or deathcause: - new, death = self.get_or_create_event(person, RelLib.EventType.DEATH, deathdate, deathplace, deathsource) + new, death = self.get_or_create_event(person, gen.lib.EventType.DEATH, deathdate, deathplace, deathsource) if deathcause: death.set_description(deathcause) self.db.commit_event(death, self.trans) death_ref = person.get_death_ref() if death_ref == None: # new - death_ref = RelLib.EventRef() + death_ref = gen.lib.EventRef() death_ref.set_reference_handle(death.get_handle()) person.set_death_ref(death_ref) if source: @@ -509,7 +509,7 @@ class CSVParser: if ref.ref == source.get_handle(): found = 1 if not found: - sref = RelLib.SourceRef() + sref = gen.lib.SourceRef() sref.set_reference_handle(source.get_handle()) person.add_source_reference(sref) self.db.commit_person(person, self.trans) @@ -545,7 +545,7 @@ class CSVParser: if self.debug: print " returning existing family" return family # if not, create one: - family = RelLib.Family() + family = gen.lib.Family() # was marked with a gramps_id, but didn't exist, so we'll use it: if family_ref.startswith("[") and family_ref.endswith("]"): family.set_gramps_id(family_ref[1:-1]) @@ -589,7 +589,7 @@ class CSVParser: if ref.ref == source.get_handle(): found = 1 if not found: - sref = RelLib.SourceRef() + sref = gen.lib.SourceRef() sref.set_reference_handle(source.get_handle()) event.add_source_reference(sref) self.db.commit_event(event,self.trans) @@ -597,9 +597,9 @@ class CSVParser: return (0, event) # else create it: if self.debug: print " creating event" - event = RelLib.Event() + event = gen.lib.Event() if type: - event.set_type(RelLib.EventType(type)) + event.set_type(gen.lib.EventType(type)) if date: event.set_date_object(date) if place: @@ -612,7 +612,7 @@ class CSVParser: if ref.ref == source.get_handle(): found = 1 if not found: - sref = RelLib.SourceRef() + sref = gen.lib.SourceRef() sref.set_reference_handle(source.get_handle()) event.add_source_reference(sref) self.db.add_event(event,self.trans) @@ -621,7 +621,7 @@ class CSVParser: def create_person(self,firstname,lastname): """ Used to create a new person we know doesn't exist """ - person = RelLib.Person() + person = gen.lib.Person() mykey = firstname+lastname self.db.add_person(person,self.trans) self.db.commit_person(person,self.trans) @@ -636,7 +636,7 @@ class CSVParser: place = self.db.get_place_from_handle(place_handle) if place.get_title() == place_name: return (0, place) - place = RelLib.Place() + place = gen.lib.Place() place.set_title(place_name) self.db.add_place(place,self.trans) self.db.commit_place(place,self.trans) @@ -650,7 +650,7 @@ class CSVParser: source = self.db.get_source_from_handle(source_handle) if source.get_title() == source_text: return (0, source) - source = RelLib.Source() + source = gen.lib.Source() source.set_title(source_text) self.db.add_source(source, self.trans) self.db.commit_source(source, self.trans) diff --git a/src/plugins/ImportGeneWeb.py b/src/plugins/ImportGeneWeb.py index d49d15b98..05b9dd041 100644 --- a/src/plugins/ImportGeneWeb.py +++ b/src/plugins/ImportGeneWeb.py @@ -53,7 +53,7 @@ import gtk.glade # #------------------------------------------------------------------------- import Errors -import RelLib +import gen.lib import const from QuestionDialog import ErrorDialog from DateHandler import parser as _dp @@ -64,15 +64,15 @@ _date_parse = re.compile('([kmes~?<>]+)?([0-9/]+)([J|H|F])?(\.\.)?([0-9/]+)?([J| _text_parse = re.compile('0\((.*)\)') _mod_map = { - '>' : RelLib.Date.MOD_AFTER, - '<' : RelLib.Date.MOD_BEFORE, - '~' : RelLib.Date.MOD_ABOUT, + '>' : gen.lib.Date.MOD_AFTER, + '<' : gen.lib.Date.MOD_BEFORE, + '~' : gen.lib.Date.MOD_ABOUT, } _cal_map = { - 'J' : RelLib.Date.CAL_JULIAN, - 'H' : RelLib.Date.CAL_HEBREW, - 'F' : RelLib.Date.CAL_FRENCH, + 'J' : gen.lib.Date.CAL_JULIAN, + 'H' : gen.lib.Date.CAL_HEBREW, + 'F' : gen.lib.Date.CAL_FRENCH, } enable_debug = False @@ -201,14 +201,14 @@ class GeneWebParser: self.current_husband_handle = None self.current_child_birthplace_handle = None self.current_child_source_handle = None - self.current_family = RelLib.Family() + self.current_family = gen.lib.Family() self.db.add_family(self.current_family,self.trans) #self.db.commit_family(self.current_family,self.trans) self.fkeys.append(self.current_family.get_handle()) idx = 1; self.debug("\nHusband:") - (idx,husband) = self.parse_person(fields,idx,RelLib.Person.MALE,None) + (idx,husband) = self.parse_person(fields,idx,gen.lib.Person.MALE,None) if husband: self.current_husband_handle = husband.get_handle() self.current_family.set_father_handle(husband.get_handle()) @@ -218,7 +218,7 @@ class GeneWebParser: self.debug("Marriage:") idx = self.parse_marriage(fields,idx) self.debug("Wife:") - (idx,wife) = self.parse_person(fields,idx,RelLib.Person.FEMALE,None) + (idx,wife) = self.parse_person(fields,idx,gen.lib.Person.FEMALE,None) if wife: self.current_family.set_mother_handle(wife.get_handle()) self.db.commit_family(self.current_family,self.trans) @@ -228,7 +228,7 @@ class GeneWebParser: def read_relationship_person(self,line,fields): self.debug("\Relationships:") - (idx,person) = self.parse_person(fields,1,RelLib.Person.UNKNOWN,None) + (idx,person) = self.parse_person(fields,1,gen.lib.Person.UNKNOWN,None) if person: self.current_relationship_person_handle = person.get_handle() @@ -251,8 +251,8 @@ class GeneWebParser: #split related person into fields fields = matches.groups()[1].split(" ") if fields: - (idx,asso_p) = self.parse_person(fields,0,RelLib.Person.UNKNOWN,None) - pref = RelLib.PersonRef() + (idx,asso_p) = self.parse_person(fields,0,gen.lib.Person.UNKNOWN,None) + pref = gen.lib.PersonRef() pref.set_relation(matches.groups()[0]) print("TODO: Handle association types properly") pref.set_reference_handle(asso_p.get_handle()) @@ -280,9 +280,9 @@ class GeneWebParser: def read_witness_line(self,line,fields): self.debug("Witness:") if fields[1] == "m:": - (idx,wit_p) = self.parse_person(fields,2,RelLib.Person.MALE,None) + (idx,wit_p) = self.parse_person(fields,2,gen.lib.Person.MALE,None) elif fields[1] == "f:": - (idx,wit_p) = self.parse_person(fields,2,RelLib.Person.FEMALE,None) + (idx,wit_p) = self.parse_person(fields,2,gen.lib.Person.FEMALE,None) else: (idx,wit_p) = self.parse_person(fields,1,None,None) if wit_p: @@ -290,15 +290,15 @@ class GeneWebParser: # search marriage event for evr in self.current_family.get_event_ref_list(): ev = self.db.get_event_from_handle(evr.get_reference_handle()) - if ev.get_type() == RelLib.EventType.MARRIAGE: + if ev.get_type() == gen.lib.EventType.MARRIAGE: mev = ev # found. if not mev: # No marriage event found create a new one - mev = self.create_event(RelLib.EventType.MARRIAGE, None, None, None, None) - mar_ref = RelLib.EventRef() + mev = self.create_event(gen.lib.EventType.MARRIAGE, None, None, None, None) + mar_ref = gen.lib.EventRef() mar_ref.set_reference_handle(mev.get_handle()) self.current_family.add_event_ref(mar_ref) - wit_ref = RelLib.EventRef() - wit_ref.set_role(RelLib.EventRoleType(RelLib.EventRoleType.WITNESS)) + wit_ref = gen.lib.EventRef() + wit_ref.set_role(gen.lib.EventRoleType(gen.lib.EventRoleType.WITNESS)) wit_ref.set_reference_handle(mev.get_handle()) wit_p.add_event_ref(wit_ref) self.db.commit_person(wit_p,self.trans) @@ -326,14 +326,14 @@ class GeneWebParser: self.debug("Child:") child = None if fields[1] == "h": - (idx,child) = self.parse_person(fields,2,RelLib.Person.MALE,father_surname) + (idx,child) = self.parse_person(fields,2,gen.lib.Person.MALE,father_surname) elif fields[1] == "f": - (idx,child) = self.parse_person(fields,2,RelLib.Person.FEMALE,father_surname) + (idx,child) = self.parse_person(fields,2,gen.lib.Person.FEMALE,father_surname) else: - (idx,child) = self.parse_person(fields,1,RelLib.Person.UNKNOWN,father_surname) + (idx,child) = self.parse_person(fields,1,gen.lib.Person.UNKNOWN,father_surname) if child: - childref = RelLib.ChildRef() + childref = gen.lib.ChildRef() childref.set_reference_handle(child.get_handle()) self.current_family.add_child_ref( childref) self.db.commit_family(self.current_family,self.trans) @@ -344,8 +344,8 @@ class GeneWebParser: if birth_ref: birth = self.db.get_event_from_handle(birth_ref.ref) if not birth: - birth = self.create_event(RelLib.EventType.BIRTH) - birth_ref = RelLib.EventRef() + birth = self.create_event(gen.lib.EventType.BIRTH) + birth_ref = gen.lib.EventRef() birth_ref.set_reference_handle(birth.get_handle()) child.set_birth_ref(birth_ref) birth.set_place_handle(self.current_child_birthplace_handle) @@ -374,7 +374,7 @@ class GeneWebParser: if not self.current_family: print "Unknown family of child in line %d!" % self.lineno return None - n = RelLib.Note() + n = gen.lib.Note() n.set(line) self.db.add_note(n,self.trans) self.current_family.add_note(n.handle) @@ -399,7 +399,7 @@ class GeneWebParser: else: note_txt = note_txt + line if note_txt: - n = RelLib.Note() + n = gen.lib.Note() n.set(note_txt) self.db.add_note(n,self.trans) return n.handle @@ -476,25 +476,25 @@ class GeneWebParser: idx = idx + 1 if mar_date or mar_place or mar_source: - mar = self.create_event(RelLib.EventType.MARRIAGE, None, mar_date, mar_place, mar_source) - mar_ref = RelLib.EventRef() + mar = self.create_event(gen.lib.EventType.MARRIAGE, None, mar_date, mar_place, mar_source) + mar_ref = gen.lib.EventRef() mar_ref.set_reference_handle(mar.get_handle()) self.current_family.add_event_ref(mar_ref) if div_date: - div = self.create_event(RelLib.EventType.DIVORCE, None, div_date, None, None) - div_ref = RelLib.EventRef() + div = self.create_event(gen.lib.EventType.DIVORCE, None, div_date, None, None) + div_ref = gen.lib.EventRef() div_ref.set_reference_handle(div.get_handle()) self.current_family.add_event_ref(div_ref) if sep_date or engaged: - sep = self.create_event(RelLib.EventType.ENGAGEMENT, None, sep_date, None, None) - sep_ref = RelLib.EventRef() + sep = self.create_event(gen.lib.EventType.ENGAGEMENT, None, sep_date, None, None) + sep_ref = gen.lib.EventRef() sep_ref.set_reference_handle(sep.get_handle()) self.current_family.add_event_ref(sep_ref) if not married: - self.current_family.set_relationship(RelLib.FamilyRelType(RelLib.FamilyRelType.UNMARRIED)) + self.current_family.set_relationship(gen.lib.FamilyRelType(gen.lib.FamilyRelType.UNMARRIED)) self.db.commit_family(self.current_family,self.trans) return idx @@ -525,12 +525,12 @@ class GeneWebParser: self.debug("Person: %s %s" % (firstname, surname)) person = self.get_or_create_person(firstname,surname) - name = RelLib.Name() - name.set_type( RelLib.NameType(RelLib.NameType.BIRTH)) + name = gen.lib.Name() + name.set_type( gen.lib.NameType(gen.lib.NameType.BIRTH)) name.set_first_name(firstname) name.set_surname(surname) person.set_primary_name(name) - if person.get_gender() == RelLib.Person.UNKNOWN and gender != None: + if person.get_gender() == gen.lib.Person.UNKNOWN and gender != None: person.set_gender(gender) self.db.commit_person(person,self.trans) personDataRe = re.compile("^[kmes0-9<>~#\[({!].*$") @@ -587,16 +587,16 @@ class GeneWebParser: pass if tnth: # Append title numer to title ttitle = "%s, %s" % (ttitle, tnth) - title = self.create_event(RelLib.EventType.NOB_TITLE,ttitle,tstart,tplace) + title = self.create_event(gen.lib.EventType.NOB_TITLE,ttitle,tstart,tplace) # TODO: Geneweb has a start date and an end date, and therefore # supprts stuff like: FROM about 1955 TO between 1998 and 1999 # gramps only supports one single date ore range. if tname and tname != "*": - n = RelLib.Note() + n = gen.lib.Note() n.set(tname) self.db.add_note(n,self.trans) title.add_note( n.handle) - title_ref = RelLib.EventRef() + title_ref = gen.lib.EventRef() title_ref.set_reference_handle(title.get_handle()) person.add_event_ref(title_ref) idx += 1 @@ -608,8 +608,8 @@ class GeneWebParser: elif fields[idx] == '#occu': idx += 1 self.debug("Occupation: %s" % fields[idx]) - occu = self.create_event(RelLib.EventType.OCCUPATION,self.decode(fields[idx])) - occu_ref = RelLib.EventRef() + occu = self.create_event(gen.lib.EventType.OCCUPATION,self.decode(fields[idx])) + occu_ref = gen.lib.EventRef() occu_ref.set_reference_handle(occu.get_handle()) person.add_event_ref(occu_ref) idx += 1 @@ -727,37 +727,37 @@ class GeneWebParser: if public_name: name = person.get_primary_name() - name.set_type(RelLib.NameType(RelLib.NameType.BIRTH)) + name.set_type(gen.lib.NameType(gen.lib.NameType.BIRTH)) person.add_alternate_name(name) - name = RelLib.Name() - name.set_type(RelLib.NameType(RelLib.NameType.AKA)) + name = gen.lib.Name() + name.set_type(gen.lib.NameType(gen.lib.NameType.AKA)) name.set_first_name(public_name) name.set_surname(surname) person.set_primary_name(name) for aka in nick_names: - name = RelLib.Attribute() - name.set_type(RelLib.AttributeType(RelLib.AttributeType.NICKNAME)) + name = gen.lib.Attribute() + name.set_type(gen.lib.AttributeType(gen.lib.AttributeType.NICKNAME)) name.set_value(aka) person.add_attribute(name) for aka in firstname_aliases: - name = RelLib.Name() - name.set_type(RelLib.NameType(RelLib.NameType.AKA)) + name = gen.lib.Name() + name.set_type(gen.lib.NameType(gen.lib.NameType.AKA)) name.set_first_name(aka) name.set_surname(surname) person.add_alternate_name(name) for aka in name_aliases: - name = RelLib.Name() - name.set_type(RelLib.NameType(RelLib.NameType.AKA)) + name = gen.lib.Name() + name.set_type(gen.lib.NameType(gen.lib.NameType.AKA)) name.set_first_name(aka) name.set_surname(surname) person.add_alternate_name(name) for aka in surname_aliases: - name = RelLib.Name() - name.set_type(RelLib.NameType(RelLib.NameType.AKA)) + name = gen.lib.Name() + name.set_type(gen.lib.NameType(gen.lib.NameType.AKA)) if public_name: name.set_first_name(public_name) else: @@ -769,35 +769,35 @@ class GeneWebParser: person.add_source_reference(source) if birth_date or birth_place or birth_source: - birth = self.create_event(RelLib.EventType.BIRTH, None, birth_date, birth_place, birth_source) - birth_ref = RelLib.EventRef() + birth = self.create_event(gen.lib.EventType.BIRTH, None, birth_date, birth_place, birth_source) + birth_ref = gen.lib.EventRef() birth_ref.set_reference_handle( birth.get_handle()) person.set_birth_ref( birth_ref) if bapt_date or bapt_place or bapt_source: - babt = self.create_event(RelLib.EventType.BAPTISM, None, bapt_date, bapt_place, bapt_source) - babt_ref = RelLib.EventRef() + babt = self.create_event(gen.lib.EventType.BAPTISM, None, bapt_date, bapt_place, bapt_source) + babt_ref = gen.lib.EventRef() babt_ref.set_reference_handle( babt.get_handle()) person.add_event_ref( babt_ref) if death_date or death_place or death_source or death_cause: - death = self.create_event(RelLib.EventType.DEATH, None, death_date, death_place, death_source) + death = self.create_event(gen.lib.EventType.DEATH, None, death_date, death_place, death_source) if death_cause: death.set_description(death_cause) self.db.commit_event(death,self.trans) - death_ref = RelLib.EventRef() + death_ref = gen.lib.EventRef() death_ref.set_reference_handle( death.get_handle()) person.set_death_ref( death_ref) if bur_date: - bur = self.create_event(RelLib.EventType.BURIAL, None, bur_date, bur_place, bur_source) - bur_ref = RelLib.EventRef() + bur = self.create_event(gen.lib.EventType.BURIAL, None, bur_date, bur_place, bur_source) + bur_ref = gen.lib.EventRef() bur_ref.set_reference_handle( bur.get_handle()) person.add_event_ref( bur_ref) if crem_date: - crem = self.create_event(RelLib.EventType.CREMATION, None, crem_date, bur_place, bur_source) - crem_ref = RelLib.EventRef() + crem = self.create_event(gen.lib.EventType.CREMATION, None, crem_date, bur_place, bur_source) + crem_ref = gen.lib.EventRef() crem_ref.set_reference_handle( crem.get_handle()) person.add_event_ref(crem_ref) @@ -808,27 +808,27 @@ class GeneWebParser: def parse_date(self,field): if field == "0": return None - date = RelLib.Date() + date = gen.lib.Date() matches = _text_parse.match(field) if matches: groups = matches.groups() date.set_as_text(groups[0]) - date.set_modifier(RelLib.Date.MOD_TEXTONLY) + date.set_modifier(gen.lib.Date.MOD_TEXTONLY) return date matches = _date_parse.match(field) if matches: groups = matches.groups() - mod = _mod_map.get(groups[0],RelLib.Date.MOD_NONE) + mod = _mod_map.get(groups[0],gen.lib.Date.MOD_NONE) if groups[3] == "..": - mod = RelLib.Date.MOD_SPAN - cal2 = _cal_map.get(groups[5],RelLib.Date.CAL_GREGORIAN) + mod = gen.lib.Date.MOD_SPAN + cal2 = _cal_map.get(groups[5],gen.lib.Date.CAL_GREGORIAN) sub2 = self.sub_date(groups[4]) else: sub2 = (0,0,0) - cal1 = _cal_map.get(groups[2],RelLib.Date.CAL_GREGORIAN) + cal1 = _cal_map.get(groups[2],gen.lib.Date.CAL_GREGORIAN) sub1 = self.sub_date(groups[1]) - date.set(RelLib.Date.QUAL_NONE,mod, cal1, + date.set(gen.lib.Date.QUAL_NONE,mod, cal1, (sub1[0],sub1[1],sub1[2],None,sub2[0],sub2[1],sub2[2],None)) return date else: @@ -844,9 +844,9 @@ class GeneWebParser: return (int(vals[0]),int(vals[1]),int(vals[2])) def create_event(self,type,desc=None,date=None,place=None,source=None): - event = RelLib.Event() + event = gen.lib.Event() if type: - event.set_type(RelLib.EventType(type)) + event.set_type(gen.lib.EventType(type)) if desc: event.set_description(desc) if date: @@ -865,7 +865,7 @@ class GeneWebParser: if mykey in self.ikeys and firstname != "?" and lastname != "?": person = self.db.get_person_from_handle(self.ikeys[mykey]) else: - person = RelLib.Person() + person = gen.lib.Person() self.db.add_person(person,self.trans) self.db.commit_person(person,self.trans) self.ikeys[mykey] = person.get_handle() @@ -876,7 +876,7 @@ class GeneWebParser: if place_name in self.pkeys: place = self.db.get_place_from_handle(self.pkeys[place_name]) else: - place = RelLib.Place() + place = gen.lib.Place() place.set_title(place_name) self.db.add_place(place,self.trans) self.db.commit_place(place,self.trans) @@ -888,12 +888,12 @@ class GeneWebParser: if source_name in self.skeys: source = self.db.get_source_from_handle(self.skeys[source_name]) else: - source = RelLib.Source() + source = gen.lib.Source() source.set_title(source_name) self.db.add_source(source,self.trans) self.db.commit_source(source,self.trans) self.skeys[source_name] = source.get_handle() - sref = RelLib.SourceRef() + sref = gen.lib.SourceRef() sref.set_reference_handle(source.get_handle()) return sref diff --git a/src/plugins/ImportvCard.py b/src/plugins/ImportvCard.py index bc6ed37d1..2b6197a6f 100644 --- a/src/plugins/ImportvCard.py +++ b/src/plugins/ImportvCard.py @@ -53,7 +53,7 @@ import gtk.glade # #------------------------------------------------------------------------- import Errors -import RelLib +import gen.lib import const from QuestionDialog import ErrorDialog from PluginUtils import register_import @@ -165,15 +165,15 @@ class VCardParser: def next_person(self): if self.person is not None: self.db.add_person(self.person,self.trans) - self.person = RelLib.Person() + self.person = gen.lib.Person() def set_nick_name(self, fields, data): self.person.set_nick_name(data) def add_name(self, fields, data): data_fields = data.split(";") - name = RelLib.Name() - name.set_type(RelLib.NameType(RelLib.NameType.AKA)) + name = gen.lib.Name() + name.set_type(gen.lib.NameType(gen.lib.NameType.AKA)) name.set_surname(data_fields[0]) name.set_first_name(data_fields[1]) if data_fields[2]: @@ -184,14 +184,14 @@ class VCardParser: self.person.set_primary_name(name) def add_title(self, fields, data): - name = RelLib.Name() - name.set_type(RelLib.NameType(RelLib.NameType.AKA)) + name = gen.lib.Name() + name.set_type(gen.lib.NameType(gen.lib.NameType.AKA)) name.set_title(data) self.person.add_alternate_name(name) def add_address(self, fields, data): data_fields = data.split(";") - addr = RelLib.Address() + addr = gen.lib.Address() addr.set_street(data_fields[0]+data_fields[1]+data_fields[2]) addr.set_city(data_fields[3]) addr.set_state(data_fields[4]) @@ -200,18 +200,18 @@ class VCardParser: self.person.add_address(addr) def add_phone(self, fields, data): - addr = RelLib.Address() + addr = gen.lib.Address() addr.set_phone(data) self.person.add_address(addr) def add_birthday(self, fields, data): - event = RelLib.Event() - event.set_type(RelLib.EventType(RelLib.EventType.BIRTH)) + event = gen.lib.Event() + event.set_type(gen.lib.EventType(gen.lib.EventType.BIRTH)) self.db.add_event(event,self.trans) self.person.set_birth_handle(event.get_handle()) def add_url(self, fields, data): - url = RelLib.Url() + url = gen.lib.Url() url.set_path(data) self.person.add_url(url) diff --git a/src/plugins/IndivComplete.py b/src/plugins/IndivComplete.py index 773c42485..554656676 100644 --- a/src/plugins/IndivComplete.py +++ b/src/plugins/IndivComplete.py @@ -41,7 +41,7 @@ import gtk # GRAMPS modules # #------------------------------------------------------------------------ -import RelLib +import gen.lib import const import Utils import BaseDoc @@ -466,9 +466,9 @@ class IndivCompleteReport(Report): self.doc.start_row() self.normal_cell("%s:" % _("Gender")) - if self.start_person.get_gender() == RelLib.Person.MALE: + if self.start_person.get_gender() == gen.lib.Person.MALE: self.normal_cell(_("Male")) - elif self.start_person.get_gender() == RelLib.Person.FEMALE: + elif self.start_person.get_gender() == gen.lib.Person.FEMALE: self.normal_cell(_("Female")) else: self.normal_cell(_("Unknown")) diff --git a/src/plugins/IndivSummary.py b/src/plugins/IndivSummary.py index 1c295e956..c89991c57 100644 --- a/src/plugins/IndivSummary.py +++ b/src/plugins/IndivSummary.py @@ -43,7 +43,7 @@ import gtk # GRAMPS modules # #------------------------------------------------------------------------ -import RelLib +import gen.lib import const import BaseDoc from PluginUtils import register_report @@ -225,7 +225,7 @@ class IndivSummary(Report): self.doc.start_cell("IVS-NormalCell") self.doc.start_paragraph("IVS-Normal") - if self.start_person.get_gender() == RelLib.Person.MALE: + if self.start_person.get_gender() == gen.lib.Person.MALE: self.doc.write_text(_("Male")) else: self.doc.write_text(_("Female")) diff --git a/src/plugins/MarkerReport.py b/src/plugins/MarkerReport.py index 4c300a4a5..bde9b705f 100644 --- a/src/plugins/MarkerReport.py +++ b/src/plugins/MarkerReport.py @@ -41,7 +41,7 @@ from ReportBase import Report, ReportUtils, ReportOptions, \ import BaseDoc import Sort import AutoComp -from RelLib import MarkerType, FamilyRelType +from gen.lib import MarkerType, FamilyRelType from Filters import GenericFilter, GenericFilterFactory, Rules from BasicUtils import name_displayer import DateHandler diff --git a/src/plugins/MediaManager.py b/src/plugins/MediaManager.py index a8c220b73..955fa222d 100644 --- a/src/plugins/MediaManager.py +++ b/src/plugins/MediaManager.py @@ -47,7 +47,7 @@ import gtk import GrampsDisplay import Assistant import Errors -from RelLib import MediaObject +from gen.lib import MediaObject from BasicUtils import UpdateCallback from PluginUtils import Tool, register_tool diff --git a/src/plugins/NarrativeWeb.py b/src/plugins/NarrativeWeb.py index 40c51e297..8acab0a30 100644 --- a/src/plugins/NarrativeWeb.py +++ b/src/plugins/NarrativeWeb.py @@ -64,7 +64,7 @@ import gtk # GRAMPS module # #------------------------------------------------------------------------ -import RelLib +import gen.lib import const from GrampsCfg import get_researcher from Filters import GenericFilter, Rules @@ -494,11 +494,11 @@ class BasePage: if not descr: descr = uri of.write('%d.' % index) - if url.get_type() == RelLib.UrlType.EMAIL and not uri.startswith("mailto:"): + if url.get_type() == gen.lib.UrlType.EMAIL and not uri.startswith("mailto:"): of.write('%s' % (uri,descr)) - elif url.get_type() == RelLib.UrlType.WEB_HOME and not uri.startswith("http://"): + elif url.get_type() == gen.lib.UrlType.WEB_HOME and not uri.startswith("http://"): of.write('%s' % (uri,descr)) - elif url.get_type() == RelLib.UrlType.WEB_FTP and not uri.startswith("ftp://"): + elif url.get_type() == gen.lib.UrlType.WEB_FTP and not uri.startswith("ftp://"): of.write('%s' % (uri,descr)) else: of.write('%s' % (uri,descr)) @@ -736,7 +736,7 @@ class IndividualListPage(BasePage): of.write('') birth = ReportUtils.get_birth_or_fallback(db, person) if birth: - if birth.get_type() == RelLib.EventType.BIRTH: + if birth.get_type() == gen.lib.EventType.BIRTH: of.write(_dd.display(birth.get_date_object())) else: of.write('') @@ -749,7 +749,7 @@ class IndividualListPage(BasePage): of.write('') death = ReportUtils.get_death_or_fallback(db, person) if death: - if death.get_type() == RelLib.EventType.DEATH: + if death.get_type() == gen.lib.EventType.DEATH: of.write(_dd.display(death.get_date_object())) else: of.write('') @@ -858,7 +858,7 @@ class SurnamePage(BasePage): of.write('') birth = ReportUtils.get_birth_or_fallback(db, person) if birth: - if birth.get_type() == RelLib.EventType.BIRTH: + if birth.get_type() == gen.lib.EventType.BIRTH: of.write(_dd.display(birth.get_date_object())) else: of.write('') @@ -871,7 +871,7 @@ class SurnamePage(BasePage): of.write('') death = ReportUtils.get_death_or_fallback(db, person) if death: - if death.get_type() == RelLib.EventType.DEATH: + if death.get_type() == gen.lib.EventType.DEATH: of.write(_dd.display(death.get_date_object())) else: of.write('') @@ -1665,9 +1665,9 @@ class ContactPage(BasePage): class IndividualPage(BasePage): gender_map = { - RelLib.Person.MALE : _('male'), - RelLib.Person.FEMALE : _('female'), - RelLib.Person.UNKNOWN : _('unknown'), + gen.lib.Person.MALE : _('male'), + gen.lib.Person.FEMALE : _('female'), + gen.lib.Person.UNKNOWN : _('unknown'), } def __init__(self, db, person, title, ind_list, @@ -1993,7 +1993,7 @@ class IndividualPage(BasePage): val) else: of.write(_nd.display(person)) - if rel != RelLib.ChildRefType.BIRTH: + if rel != gen.lib.ChildRefType.BIRTH: of.write('   (%s)' % str(rel)) of.write('\n') @@ -2124,10 +2124,10 @@ class IndividualPage(BasePage): gender = self.person.get_gender() reltype = family.get_relationship() - if reltype == RelLib.FamilyRelType.MARRIED: - if gender == RelLib.Person.FEMALE: + if reltype == gen.lib.FamilyRelType.MARRIED: + if gender == gen.lib.Person.FEMALE: relstr = _("Husband") - elif gender == RelLib.Person.MALE: + elif gender == gen.lib.Person.MALE: relstr = _("Wife") else: relstr = _("Partner") diff --git a/src/plugins/PatchNames.py b/src/plugins/PatchNames.py index 56ec5cfc8..1cd106aee 100644 --- a/src/plugins/PatchNames.py +++ b/src/plugins/PatchNames.py @@ -49,7 +49,7 @@ from PluginUtils import Tool, register_tool from QuestionDialog import OkDialog import ManagedWindow import GrampsDisplay -import RelLib +import gen.lib #------------------------------------------------------------------------- # @@ -286,8 +286,8 @@ class PatchNames(Tool.BatchTool, ManagedWindow.ManagedWindow): name = p.get_primary_name() name.set_first_name(grp[1].strip()) nick_name = grp[2].strip() - attr = RelLib.Attribute() - attr.set_type(RelLib.AttributeType.NICKNAME) + attr = gen.lib.Attribute() + attr.set_type(gen.lib.AttributeType.NICKNAME) attr.set_value(nick_name) p.add_attribute(attr) self.db.commit_person(p,self.trans) diff --git a/src/plugins/Rebuild.py b/src/plugins/Rebuild.py index 5acdc2a75..09e4625ab 100644 --- a/src/plugins/Rebuild.py +++ b/src/plugins/Rebuild.py @@ -52,7 +52,7 @@ import gtk.glade # GRAMPS modules # #------------------------------------------------------------------------- -import RelLib +import gen.lib import const from PluginUtils import Tool, register_tool from QuestionDialog import OkDialog diff --git a/src/plugins/RebuildRefMap.py b/src/plugins/RebuildRefMap.py index 1ff10801c..deb216a1f 100644 --- a/src/plugins/RebuildRefMap.py +++ b/src/plugins/RebuildRefMap.py @@ -54,7 +54,7 @@ import gtk.glade # GRAMPS modules # #------------------------------------------------------------------------- -import RelLib +import gen.lib import const from PluginUtils import Tool, register_tool from QuestionDialog import OkDialog diff --git a/src/plugins/RelCalc.py b/src/plugins/RelCalc.py index e9f0769d5..e34c1efe9 100644 --- a/src/plugins/RelCalc.py +++ b/src/plugins/RelCalc.py @@ -42,7 +42,7 @@ import gtk.glade # GRAMPS modules # #------------------------------------------------------------------------- -import RelLib +import gen.lib from BasicUtils import name_displayer import ManagedWindow import ListModel diff --git a/src/plugins/ReorderIds.py b/src/plugins/ReorderIds.py index 9fb6ec952..7a94c7721 100644 --- a/src/plugins/ReorderIds.py +++ b/src/plugins/ReorderIds.py @@ -39,7 +39,7 @@ from gettext import gettext as _ # #------------------------------------------------------------------------ import Utils -import RelLib +import gen.lib from PluginUtils import Tool, register_tool _findint = re.compile('^[^\d]*(\d+)[^\d]*') @@ -68,7 +68,7 @@ class ReorderIds(Tool.BatchTool): if uistate: self.progress.set_pass(_('Reordering People IDs'), db.get_number_of_people()) - self.reorder(RelLib.Person, + self.reorder(gen.lib.Person, db.get_person_from_gramps_id, db.get_person_from_handle, db.find_next_person_gramps_id, @@ -79,7 +79,7 @@ class ReorderIds(Tool.BatchTool): if uistate: self.progress.set_pass(_('Reordering Family IDs'), db.get_number_of_families()) - self.reorder(RelLib.Family, + self.reorder(gen.lib.Family, db.get_family_from_gramps_id, db.get_family_from_handle, db.find_next_family_gramps_id, @@ -89,7 +89,7 @@ class ReorderIds(Tool.BatchTool): if uistate: self.progress.set_pass(_('Reordering Event IDs'), db.get_number_of_events()) - self.reorder(RelLib.Event, + self.reorder(gen.lib.Event, db.get_event_from_gramps_id, db.get_event_from_handle, db.find_next_event_gramps_id, @@ -99,7 +99,7 @@ class ReorderIds(Tool.BatchTool): if uistate: self.progress.set_pass(_('Reordering Media Object IDs'), db.get_number_of_media_objects()) - self.reorder(RelLib.MediaObject, + self.reorder(gen.lib.MediaObject, db.get_object_from_gramps_id, db.get_object_from_handle, db.find_next_object_gramps_id, @@ -109,7 +109,7 @@ class ReorderIds(Tool.BatchTool): if uistate: self.progress.set_pass(_('Reordering Source IDs'), db.get_number_of_sources()) - self.reorder(RelLib.Source, + self.reorder(gen.lib.Source, db.get_source_from_gramps_id, db.get_source_from_handle, db.find_next_source_gramps_id, @@ -119,7 +119,7 @@ class ReorderIds(Tool.BatchTool): if uistate: self.progress.set_pass(_('Reordering Place IDs'), db.get_number_of_places()) - self.reorder(RelLib.Place, + self.reorder(gen.lib.Place, db.get_place_from_gramps_id, db.get_place_from_handle, db.find_next_place_gramps_id, @@ -129,7 +129,7 @@ class ReorderIds(Tool.BatchTool): if uistate: self.progress.set_pass(_('Reordering Repository IDs'), db.get_number_of_repositories()) - self.reorder(RelLib.Repository, + self.reorder(gen.lib.Repository, db.get_repository_from_gramps_id, db.get_repository_from_handle, db.find_next_repository_gramps_id, diff --git a/src/plugins/StatisticsChart.py b/src/plugins/StatisticsChart.py index 40af85e20..5fde8e358 100644 --- a/src/plugins/StatisticsChart.py +++ b/src/plugins/StatisticsChart.py @@ -51,7 +51,7 @@ import gtk #------------------------------------------------------------------------ # Person and relation types -from RelLib import Person, FamilyRelType, EventType +from gen.lib import Person, FamilyRelType, EventType # gender and report type names import BaseDoc from PluginUtils import register_report diff --git a/src/plugins/Summary.py b/src/plugins/Summary.py index dd56dc403..73fd946bf 100644 --- a/src/plugins/Summary.py +++ b/src/plugins/Summary.py @@ -43,7 +43,7 @@ import gtk.glade # GRAMPS modules # #------------------------------------------------------------------------ -import RelLib +import gen.lib from PluginUtils import register_report from ReportBase import CATEGORY_VIEW, MODE_GUI import DateHandler @@ -101,9 +101,9 @@ def build_report(database,person): missing_bday = missing_bday + 1 else: missing_bday = missing_bday + 1 - if person.get_gender() == RelLib.Person.FEMALE: + if person.get_gender() == gen.lib.Person.FEMALE: females = females + 1 - elif person.get_gender() == RelLib.Person.MALE: + elif person.get_gender() == gen.lib.Person.MALE: males = males + 1 else: unknowns += 1 diff --git a/src/plugins/TestcaseGenerator.py b/src/plugins/TestcaseGenerator.py index 888abda95..b3d4adbc1 100644 --- a/src/plugins/TestcaseGenerator.py +++ b/src/plugins/TestcaseGenerator.py @@ -47,7 +47,7 @@ import gtk.glade # #------------------------------------------------------------------------- import Errors -import RelLib +import gen.lib from PluginUtils import Tool, register_tool import const import Utils @@ -234,7 +234,7 @@ class TestcaseGenerator(Tool.Tool): print "TESTING SIGNALS..." print "\nCREATE PERSON" - p = RelLib.Person() + p = gen.lib.Person() h = self.db.add_person( p, self.trans) print "\nUPDATE PERSON" self.db.commit_person( p, self.trans) @@ -242,7 +242,7 @@ class TestcaseGenerator(Tool.Tool): self.db.remove_person( h, self.trans) print "\nCREATE FAMILY" - f = RelLib.Family() + f = gen.lib.Family() h = self.db.add_family( f, self.trans) print "\nUPDATE FAMILY" self.db.commit_family( f, self.trans) @@ -250,7 +250,7 @@ class TestcaseGenerator(Tool.Tool): self.db.remove_family( h, self.trans) print "\nCREATE EVENT" - e = RelLib.Event() + e = gen.lib.Event() h = self.db.add_event( e, self.trans) print "\nUPDATE EVENT" self.db.commit_event( e, self.trans) @@ -258,7 +258,7 @@ class TestcaseGenerator(Tool.Tool): self.db.remove_event( h, self.trans) print "\nCREATE PLACE" - p = RelLib.Place() + p = gen.lib.Place() h = self.db.add_place( p, self.trans) print "\nUPDATE PLACE" self.db.commit_place( p, self.trans) @@ -266,7 +266,7 @@ class TestcaseGenerator(Tool.Tool): self.db.remove_place( h, self.trans) print "\nCREATE SOURCE" - s = RelLib.Source() + s = gen.lib.Source() h = self.db.add_source( s, self.trans) print "\nUPDATE SOURCE" self.db.commit_source( s, self.trans) @@ -274,7 +274,7 @@ class TestcaseGenerator(Tool.Tool): self.db.remove_source( h, self.trans) print "\nCREATE MEDIA" - m = RelLib.MediaObject() + m = gen.lib.MediaObject() h = self.db.add_object( m, self.trans) print "\nUPDATE MEDIA" self.db.commit_media_object( m, self.trans) @@ -374,12 +374,12 @@ class TestcaseGenerator(Tool.Tool): def generate_broken_relations(self): # Create a family, that links to father and mother, but father does not link back - person1_h = self.generate_person(RelLib.Person.MALE,"Broken1","Family links to this person, but person does not link back") - person2_h = self.generate_person(RelLib.Person.FEMALE,"Broken1",None) - fam = RelLib.Family() + person1_h = self.generate_person(gen.lib.Person.MALE,"Broken1","Family links to this person, but person does not link back") + person2_h = self.generate_person(gen.lib.Person.FEMALE,"Broken1",None) + fam = gen.lib.Family() fam.set_father_handle(person1_h) fam.set_mother_handle(person2_h) - fam.set_relationship((RelLib.FamilyRelType.MARRIED,'')) + fam.set_relationship((gen.lib.FamilyRelType.MARRIED,'')) fam_h = self.db.add_family(fam,self.trans) #person1 = self.db.get_person_from_handle(person1_h) #person1.add_family_handle(fam_h) @@ -390,12 +390,12 @@ class TestcaseGenerator(Tool.Tool): self.commit_transaction() # COMMIT TRANSACTION STEP # Create a family, that misses the link to the father - person1_h = self.generate_person(RelLib.Person.MALE,"Broken2",None) - person2_h = self.generate_person(RelLib.Person.FEMALE,"Broken2",None) - fam = RelLib.Family() + person1_h = self.generate_person(gen.lib.Person.MALE,"Broken2",None) + person2_h = self.generate_person(gen.lib.Person.FEMALE,"Broken2",None) + fam = gen.lib.Family() #fam.set_father_handle(person1_h) fam.set_mother_handle(person2_h) - fam.set_relationship((RelLib.FamilyRelType.MARRIED,'')) + fam.set_relationship((gen.lib.FamilyRelType.MARRIED,'')) fam_h = self.db.add_family(fam,self.trans) person1 = self.db.get_person_from_handle(person1_h) person1.add_family_handle(fam_h) @@ -406,12 +406,12 @@ class TestcaseGenerator(Tool.Tool): self.commit_transaction() # COMMIT TRANSACTION STEP # Create a family, that misses the link to the mother - person1_h = self.generate_person(RelLib.Person.MALE,"Broken3",None) - person2_h = self.generate_person(RelLib.Person.FEMALE,"Broken3",None) - fam = RelLib.Family() + person1_h = self.generate_person(gen.lib.Person.MALE,"Broken3",None) + person2_h = self.generate_person(gen.lib.Person.FEMALE,"Broken3",None) + fam = gen.lib.Family() fam.set_father_handle(person1_h) #fam.set_mother_handle(person2_h) - fam.set_relationship((RelLib.FamilyRelType.MARRIED,'')) + fam.set_relationship((gen.lib.FamilyRelType.MARRIED,'')) fam_h = self.db.add_family(fam,self.trans) person1 = self.db.get_person_from_handle(person1_h) person1.add_family_handle(fam_h) @@ -422,12 +422,12 @@ class TestcaseGenerator(Tool.Tool): self.commit_transaction() # COMMIT TRANSACTION STEP # Create a family, that links to father and mother, but father does not link back - person1_h = self.generate_person(RelLib.Person.MALE,"Broken4",None) - person2_h = self.generate_person(RelLib.Person.FEMALE,"Broken4","Family links to this person, but person does not link back") - fam = RelLib.Family() + person1_h = self.generate_person(gen.lib.Person.MALE,"Broken4",None) + person2_h = self.generate_person(gen.lib.Person.FEMALE,"Broken4","Family links to this person, but person does not link back") + fam = gen.lib.Family() fam.set_father_handle(person1_h) fam.set_mother_handle(person2_h) - fam.set_relationship((RelLib.FamilyRelType.MARRIED,'')) + fam.set_relationship((gen.lib.FamilyRelType.MARRIED,'')) fam_h = self.db.add_family(fam,self.trans) person1 = self.db.get_person_from_handle(person1_h) person1.add_family_handle(fam_h) @@ -438,12 +438,12 @@ class TestcaseGenerator(Tool.Tool): self.commit_transaction() # COMMIT TRANSACTION STEP # Create two married people of same sex. - person1_h = self.generate_person(RelLib.Person.MALE,"Broken5",None) - person2_h = self.generate_person(RelLib.Person.MALE,"Broken5",None) - fam = RelLib.Family() + person1_h = self.generate_person(gen.lib.Person.MALE,"Broken5",None) + person2_h = self.generate_person(gen.lib.Person.MALE,"Broken5",None) + fam = gen.lib.Family() fam.set_father_handle(person1_h) fam.set_mother_handle(person2_h) - fam.set_relationship((RelLib.FamilyRelType.MARRIED,'')) + fam.set_relationship((gen.lib.FamilyRelType.MARRIED,'')) fam_h = self.db.add_family(fam,self.trans) person1 = self.db.get_person_from_handle(person1_h) person1.add_family_handle(fam_h) @@ -454,12 +454,12 @@ class TestcaseGenerator(Tool.Tool): self.commit_transaction() # COMMIT TRANSACTION STEP # Create a family, that contains an invalid handle to for the father - #person1_h = self.generate_person(RelLib.Person.MALE,"Broken6",None) - person2_h = self.generate_person(RelLib.Person.FEMALE,"Broken6",None) - fam = RelLib.Family() + #person1_h = self.generate_person(gen.lib.Person.MALE,"Broken6",None) + person2_h = self.generate_person(gen.lib.Person.FEMALE,"Broken6",None) + fam = gen.lib.Family() fam.set_father_handle("InvalidHandle1") fam.set_mother_handle(person2_h) - fam.set_relationship((RelLib.FamilyRelType.MARRIED,'')) + fam.set_relationship((gen.lib.FamilyRelType.MARRIED,'')) fam_h = self.db.add_family(fam,self.trans) #person1 = self.db.get_person_from_handle(person1_h) #person1.add_family_handle(fam_h) @@ -470,12 +470,12 @@ class TestcaseGenerator(Tool.Tool): self.commit_transaction() # COMMIT TRANSACTION STEP # Create a family, that contains an invalid handle to for the mother - person1_h = self.generate_person(RelLib.Person.MALE,"Broken7",None) - #person2_h = self.generate_person(RelLib.Person.FEMALE,"Broken7",None) - fam = RelLib.Family() + person1_h = self.generate_person(gen.lib.Person.MALE,"Broken7",None) + #person2_h = self.generate_person(gen.lib.Person.FEMALE,"Broken7",None) + fam = gen.lib.Family() fam.set_father_handle(person1_h) fam.set_mother_handle("InvalidHandle2") - fam.set_relationship((RelLib.FamilyRelType.MARRIED,'')) + fam.set_relationship((gen.lib.FamilyRelType.MARRIED,'')) fam_h = self.db.add_family(fam,self.trans) person1 = self.db.get_person_from_handle(person1_h) person1.add_family_handle(fam_h) @@ -487,14 +487,14 @@ class TestcaseGenerator(Tool.Tool): # Creates a family where the child does not link back to the family - person1_h = self.generate_person(RelLib.Person.MALE,"Broken8",None) - person2_h = self.generate_person(RelLib.Person.FEMALE,"Broken8",None) + person1_h = self.generate_person(gen.lib.Person.MALE,"Broken8",None) + person2_h = self.generate_person(gen.lib.Person.FEMALE,"Broken8",None) child_h = self.generate_person(None,"Broken8",None) - fam = RelLib.Family() + fam = gen.lib.Family() fam.set_father_handle(person1_h) fam.set_mother_handle(person2_h) - fam.set_relationship((RelLib.FamilyRelType.MARRIED,'')) - child_ref = RelLib.ChildRef() + fam.set_relationship((gen.lib.FamilyRelType.MARRIED,'')) + child_ref = gen.lib.ChildRef() child_ref.set_reference_handle(child_h) self.fill_object(child_ref) fam.add_child_ref(child_ref) @@ -511,15 +511,15 @@ class TestcaseGenerator(Tool.Tool): self.commit_transaction() # COMMIT TRANSACTION STEP # Creates a family where the child is not linked, but the child links to the family - person1_h = self.generate_person(RelLib.Person.MALE,"Broken9",None) - person2_h = self.generate_person(RelLib.Person.FEMALE,"Broken9",None) + person1_h = self.generate_person(gen.lib.Person.MALE,"Broken9",None) + person2_h = self.generate_person(gen.lib.Person.FEMALE,"Broken9",None) child_h = self.generate_person(None,"Broken9",None) - fam = RelLib.Family() + fam = gen.lib.Family() fam.set_father_handle(person1_h) fam.set_mother_handle(person2_h) - fam.set_relationship((RelLib.FamilyRelType.MARRIED,'')) + fam.set_relationship((gen.lib.FamilyRelType.MARRIED,'')) #fam.add_child_handle(child_h) - child_ref = RelLib.ChildRef() + child_ref = gen.lib.ChildRef() child_ref.set_reference_handle(child_h) self.fill_object(child_ref) fam.add_child_ref(child_ref) @@ -538,7 +538,7 @@ class TestcaseGenerator(Tool.Tool): # Creates a person having a non existing birth event handle set person_h = self.generate_person(None,"Broken11",None) person = self.db.get_person_from_handle(person_h) - event_ref = RelLib.EventRef() + event_ref = gen.lib.EventRef() event_ref.set_reference_handle("InvalidHandle4") person.set_birth_ref(event_ref) self.db.commit_person(person,self.trans) @@ -547,7 +547,7 @@ class TestcaseGenerator(Tool.Tool): # Creates a person having a non existing death event handle set person_h = self.generate_person(None,"Broken12",None) person = self.db.get_person_from_handle(person_h) - event_ref = RelLib.EventRef() + event_ref = gen.lib.EventRef() event_ref.set_reference_handle("InvalidHandle5") person.set_death_ref(event_ref) self.db.commit_person(person,self.trans) @@ -556,7 +556,7 @@ class TestcaseGenerator(Tool.Tool): # Creates a person having a non existing event handle set person_h = self.generate_person(None,"Broken13",None) person = self.db.get_person_from_handle(person_h) - event_ref = RelLib.EventRef() + event_ref = gen.lib.EventRef() event_ref.set_reference_handle("InvalidHandle6") person.add_event_ref(event_ref) self.db.commit_person(person,self.trans) @@ -564,11 +564,11 @@ class TestcaseGenerator(Tool.Tool): # Creates a person with a birth event having an empty type person_h = self.generate_person(None,"Broken14",None) - event = RelLib.Event() + event = gen.lib.Event() event.set_type('') event.set_description("Test for Broken14") event_h = self.db.add_event(event,self.trans) - event_ref = RelLib.EventRef() + event_ref = gen.lib.EventRef() event_ref.set_reference_handle(event_h) person = self.db.get_person_from_handle(person_h) person.set_birth_ref(event_ref) @@ -577,10 +577,10 @@ class TestcaseGenerator(Tool.Tool): # Creates a person with a death event having an empty type person_h = self.generate_person(None,"Broken15",None) - event = RelLib.Event() + event = gen.lib.Event() event.set_description("Test for Broken15") event_h = self.db.add_event(event,self.trans) - event_ref = RelLib.EventRef() + event_ref = gen.lib.EventRef() event_ref.set_reference_handle(event_h) person = self.db.get_person_from_handle(person_h) person.set_death_ref(event_ref) @@ -589,10 +589,10 @@ class TestcaseGenerator(Tool.Tool): # Creates a person with an event having an empty type person_h = self.generate_person(None,"Broken16",None) - event = RelLib.Event() + event = gen.lib.Event() event.set_description("Test for Broken16") event_h = self.db.add_event(event,self.trans) - event_ref = RelLib.EventRef() + event_ref = gen.lib.EventRef() event_ref.set_reference_handle(event_h) person = self.db.get_person_from_handle(person_h) person.add_event_ref(event_ref) @@ -601,12 +601,12 @@ class TestcaseGenerator(Tool.Tool): # Creates a person with a birth event pointing to nonexisting place person_h = self.generate_person(None,"Broken17",None) - event = RelLib.Event() - event.set_type(RelLib.EventType.BIRTH) + event = gen.lib.Event() + event.set_type(gen.lib.EventType.BIRTH) event.set_place_handle("InvalidHandle7") event.set_description("Test for Broken17") event_h = self.db.add_event(event,self.trans) - event_ref = RelLib.EventRef() + event_ref = gen.lib.EventRef() event_ref.set_reference_handle(event_h) person = self.db.get_person_from_handle(person_h) person.set_birth_ref(event_ref) @@ -615,12 +615,12 @@ class TestcaseGenerator(Tool.Tool): # Creates a person with an event pointing to nonexisting place person_h = self.generate_person(None,"Broken18",None) - event = RelLib.Event() - event.set_type(RelLib.EventType.BIRTH) + event = gen.lib.Event() + event.set_type(gen.lib.EventType.BIRTH) event.set_place_handle("InvalidHandle8") event.set_description("Test for Broken18") event_h = self.db.add_event(event,self.trans) - event_ref = RelLib.EventRef() + event_ref = gen.lib.EventRef() event_ref.set_reference_handle(event_h) person = self.db.get_person_from_handle(person_h) person.add_event_ref(event_ref) @@ -631,88 +631,88 @@ class TestcaseGenerator(Tool.Tool): def generate_date_tests(self): dates = [] # first some valid dates - calendar = RelLib.Date.CAL_GREGORIAN - for quality in (RelLib.Date.QUAL_NONE, RelLib.Date.QUAL_ESTIMATED, - RelLib.Date.QUAL_CALCULATED): - for modifier in (RelLib.Date.MOD_NONE, RelLib.Date.MOD_BEFORE, - RelLib.Date.MOD_AFTER, RelLib.Date.MOD_ABOUT): + calendar = gen.lib.Date.CAL_GREGORIAN + for quality in (gen.lib.Date.QUAL_NONE, gen.lib.Date.QUAL_ESTIMATED, + gen.lib.Date.QUAL_CALCULATED): + for modifier in (gen.lib.Date.MOD_NONE, gen.lib.Date.MOD_BEFORE, + gen.lib.Date.MOD_AFTER, gen.lib.Date.MOD_ABOUT): for slash1 in (False,True): - d = RelLib.Date() + d = gen.lib.Date() d.set(quality,modifier,calendar,(4,7,1789,slash1),"Text comment") dates.append( d) - for modifier in (RelLib.Date.MOD_RANGE, RelLib.Date.MOD_SPAN): + for modifier in (gen.lib.Date.MOD_RANGE, gen.lib.Date.MOD_SPAN): for slash1 in (False,True): for slash2 in (False,True): - d = RelLib.Date() + d = gen.lib.Date() d.set(quality,modifier,calendar,(4,7,1789,slash1,5,8,1876,slash2),"Text comment") dates.append( d) - modifier = RelLib.Date.MOD_TEXTONLY - d = RelLib.Date() - d.set(quality,modifier,calendar,RelLib.Date.EMPTY, + modifier = gen.lib.Date.MOD_TEXTONLY + d = gen.lib.Date() + d.set(quality,modifier,calendar,gen.lib.Date.EMPTY, "This is a textual date") dates.append( d) # test invalid dates dateval = (4,7,1789,False,5,8,1876,False) for l in range(1,len(dateval)): - d = RelLib.Date() + d = gen.lib.Date() try: - d.set(RelLib.Date.QUAL_NONE,RelLib.Date.MOD_NONE, - RelLib.Date.CAL_GREGORIAN,dateval[:l],"Text comment") + d.set(gen.lib.Date.QUAL_NONE,gen.lib.Date.MOD_NONE, + gen.lib.Date.CAL_GREGORIAN,dateval[:l],"Text comment") dates.append( d) except Errors.DateError, e: d.set_as_text("Date identified value correctly as invalid.\n%s" % e) dates.append( d) except: - d = RelLib.Date() + d = gen.lib.Date() d.set_as_text("Date.set Exception %s" % ("".join(traceback.format_exception(*sys.exc_info())),)) dates.append( d) for l in range(1,len(dateval)): - d = RelLib.Date() + d = gen.lib.Date() try: - d.set(RelLib.Date.QUAL_NONE,RelLib.Date.MOD_SPAN,RelLib.Date.CAL_GREGORIAN,dateval[:l],"Text comment") + d.set(gen.lib.Date.QUAL_NONE,gen.lib.Date.MOD_SPAN,gen.lib.Date.CAL_GREGORIAN,dateval[:l],"Text comment") dates.append( d) except Errors.DateError, e: d.set_as_text("Date identified value correctly as invalid.\n%s" % e) dates.append( d) except: - d = RelLib.Date() + d = gen.lib.Date() d.set_as_text("Date.set Exception %s" % ("".join(traceback.format_exception(*sys.exc_info())),)) dates.append( d) - d = RelLib.Date() - d.set(RelLib.Date.QUAL_NONE,RelLib.Date.MOD_NONE, - RelLib.Date.CAL_GREGORIAN,(44,7,1789,False),"Text comment") + d = gen.lib.Date() + d.set(gen.lib.Date.QUAL_NONE,gen.lib.Date.MOD_NONE, + gen.lib.Date.CAL_GREGORIAN,(44,7,1789,False),"Text comment") dates.append( d) - d = RelLib.Date() - d.set(RelLib.Date.QUAL_NONE,RelLib.Date.MOD_NONE, - RelLib.Date.CAL_GREGORIAN,(4,77,1789,False),"Text comment") + d = gen.lib.Date() + d.set(gen.lib.Date.QUAL_NONE,gen.lib.Date.MOD_NONE, + gen.lib.Date.CAL_GREGORIAN,(4,77,1789,False),"Text comment") dates.append( d) - d = RelLib.Date() - d.set(RelLib.Date.QUAL_NONE,RelLib.Date.MOD_SPAN, - RelLib.Date.CAL_GREGORIAN, + d = gen.lib.Date() + d.set(gen.lib.Date.QUAL_NONE,gen.lib.Date.MOD_SPAN, + gen.lib.Date.CAL_GREGORIAN, (4,7,1789,False,55,8,1876,False),"Text comment") dates.append( d) - d = RelLib.Date() - d.set(RelLib.Date.QUAL_NONE,RelLib.Date.MOD_SPAN, - RelLib.Date.CAL_GREGORIAN, + d = gen.lib.Date() + d.set(gen.lib.Date.QUAL_NONE,gen.lib.Date.MOD_SPAN, + gen.lib.Date.CAL_GREGORIAN, (4,7,1789,False,5,88,1876,False),"Text comment") dates.append( d) # now add them as birth to new persons i = 1 for dateval in dates: - person = RelLib.Person() - name = RelLib.Name() + person = gen.lib.Person() + name = gen.lib.Name() name.set_surname("DateTest") name.set_first_name("Test %d" % i) person.set_primary_name( name) self.db.add_person(person,self.trans) - bevent = RelLib.Event() - bevent.set_type(RelLib.EventType.BIRTH) + bevent = gen.lib.Event() + bevent.set_type(gen.lib.EventType.BIRTH) bevent.set_date_object(dateval) bevent_h = self.db.add_event(bevent,self.trans) self.generated_events.append(bevent_h) - bevent_ref = RelLib.EventRef() + bevent_ref = gen.lib.EventRef() bevent_ref.set_reference_handle(bevent_h) # for the death event display the date as text and parse it back to a new date ndate = None @@ -721,36 +721,36 @@ class TestcaseGenerator(Tool.Tool): try: ndate = _dp.parse( datestr) if not ndate: - ndate = RelLib.Date() + ndate = gen.lib.Date() ndate.set_as_text("DateParser None") - person.set_marker(RelLib.MarkerType.TODO_TYPE) + person.set_marker(gen.lib.MarkerType.TODO_TYPE) else: - person.set_marker(RelLib.MarkerType.COMPLETE) + person.set_marker(gen.lib.MarkerType.COMPLETE) except: - ndate = RelLib.Date() + ndate = gen.lib.Date() ndate.set_as_text("DateParser Exception %s" % ("".join(traceback.format_exception(*sys.exc_info())),)) - person.set_marker(RelLib.MarkerType.TODO_TYPE) + person.set_marker(gen.lib.MarkerType.TODO_TYPE) except: - ndate = RelLib.Date() + ndate = gen.lib.Date() ndate.set_as_text("DateDisplay Exception: %s" % ("".join(traceback.format_exception(*sys.exc_info())),)) - person.set_marker(RelLib.MarkerType.TODO_TYPE) + person.set_marker(gen.lib.MarkerType.TODO_TYPE) - if dateval.get_modifier() != RelLib.Date.MOD_TEXTONLY \ - and ndate.get_modifier() == RelLib.Date.MOD_TEXTONLY: + if dateval.get_modifier() != gen.lib.Date.MOD_TEXTONLY \ + and ndate.get_modifier() == gen.lib.Date.MOD_TEXTONLY: # parser was unable to correctly parse the string ndate.set_as_text( "TEXTONLY: "+ndate.get_text()) - person.set_marker(RelLib.MarkerType.TODO_TYPE) - if dateval.get_modifier() == RelLib.Date.MOD_TEXTONLY \ + person.set_marker(gen.lib.MarkerType.TODO_TYPE) + if dateval.get_modifier() == gen.lib.Date.MOD_TEXTONLY \ and dateval.get_text().count("Traceback") \ - and person.get_marker() == RelLib.MarkerType.COMPLETE: - person.set_marker(RelLib.MarkerType.TODO_TYPE) + and person.get_marker() == gen.lib.MarkerType.COMPLETE: + person.set_marker(gen.lib.MarkerType.TODO_TYPE) - devent = RelLib.Event() - devent.set_type(RelLib.EventType.DEATH) + devent = gen.lib.Event() + devent.set_type(gen.lib.EventType.DEATH) devent.set_date_object(ndate) devent_h = self.db.add_event(devent,self.trans) self.generated_events.append(devent_h) - devent_ref = RelLib.EventRef() + devent_ref = gen.lib.EventRef() devent_ref.set_reference_handle(devent_h) person.set_birth_ref(bevent_ref) person.set_death_ref(devent_ref) @@ -767,19 +767,19 @@ class TestcaseGenerator(Tool.Tool): self.commit_transaction() # COMMIT TRANSACTION STEP - np = RelLib.Person() + np = gen.lib.Person() self.fill_object(np) # Gender if gender == None: gender = randint(0,1) if randint(0,10) == 1: # Set some persons to unknown gender - np.set_gender(RelLib.Person.UNKNOWN) + np.set_gender(gen.lib.Person.UNKNOWN) else: np.set_gender(gender) # Name - name = RelLib.Name() + name = gen.lib.Name() self.fill_object( name) (firstname,lastname) = self.rand_name(lastname, gender) name.set_first_name(firstname) @@ -799,7 +799,7 @@ class TestcaseGenerator(Tool.Tool): # generate some slightly different alternate name firstname2 = firstname.replace("m", "n").replace("l", "i").replace("b", "d") if firstname2 != firstname: - alt_name = RelLib.Name(name) + alt_name = gen.lib.Name(name) self.fill_object( alt_name) if randint(0,2) == 1: alt_name.set_surname(self.rand_text(self.LASTNAME)) @@ -820,7 +820,7 @@ class TestcaseGenerator(Tool.Tool): np.add_alternate_name( alt_name) firstname2 = firstname.replace("a", "e").replace("o", "u").replace("r", "p") if firstname2 != firstname: - alt_name = RelLib.Name(name) + alt_name = gen.lib.Name(name) self.fill_object( alt_name) if randint(0,2) == 1: alt_name.set_surname(self.rand_text(self.LASTNAME)) @@ -848,25 +848,25 @@ class TestcaseGenerator(Tool.Tool): # birth if randint(0,1) == 1: - (birth_year, eref) = self.rand_personal_event( RelLib.EventType.BIRTH, by,by) + (birth_year, eref) = self.rand_personal_event( gen.lib.EventType.BIRTH, by,by) np.set_birth_ref(eref) # baptism if randint(0,1) == 1: (bapt_year, eref) = self.rand_personal_event( - choice( (RelLib.EventType.BAPTISM, RelLib.EventType.CHRISTEN)), by, by+2) + choice( (gen.lib.EventType.BAPTISM, gen.lib.EventType.CHRISTEN)), by, by+2) np.add_event_ref(eref) # death death_year = None if randint(0,1) == 1: - (death_year, eref) = self.rand_personal_event( RelLib.EventType.DEATH, dy,dy) + (death_year, eref) = self.rand_personal_event( gen.lib.EventType.DEATH, dy,dy) np.set_death_ref(eref) # burial if randint(0,1) == 1: (bur_year, eref) = self.rand_personal_event( - choice( (RelLib.EventType.BURIAL, RelLib.EventType.CREMATION)), dy, dy+2) + choice( (gen.lib.EventType.BURIAL, gen.lib.EventType.CREMATION)), dy, dy+2) np.add_event_ref(eref) # some other events @@ -878,10 +878,10 @@ class TestcaseGenerator(Tool.Tool): if self.generated_events: while randint(0,5) == 1: e_h = choice(self.generated_events) - eref = RelLib.EventRef() + eref = gen.lib.EventRef() self.fill_object( eref) eref.set_reference_handle(e_h) - eref.set_role( self.rand_type(RelLib.EventRoleType())) + eref.set_role( self.rand_type(gen.lib.EventRoleType())) np.add_event_ref(eref) # PersonRef @@ -893,7 +893,7 @@ class TestcaseGenerator(Tool.Tool): asso_h = self.generate_person(None, None, alive_in_year = alive_in_year) else: asso_h = self.generate_person() - asso = RelLib.PersonRef() + asso = gen.lib.PersonRef() asso.set_reference_handle(asso_h) asso.set_relation(self.rand_text(self.SHORT)) self.fill_object(asso) @@ -942,7 +942,7 @@ class TestcaseGenerator(Tool.Tool): if person2_h and randint(0,2) > 0: self.parents_todo.append(person2_h) - fam = RelLib.Family() + fam = gen.lib.Family() self.add_defaults(fam) if person1_h: fam.set_father_handle(person1_h) @@ -972,7 +972,7 @@ class TestcaseGenerator(Tool.Tool): (born,died) = self.person_dates[child_h] alive_in_year = born fam = self.db.get_family_from_handle(fam_h) - child_ref = RelLib.ChildRef() + child_ref = gen.lib.ChildRef() child_ref.set_reference_handle(child_h) self.fill_object(child_ref) fam.add_child_ref(child_ref) @@ -1008,11 +1008,11 @@ class TestcaseGenerator(Tool.Tool): if randint(0,2) > 1: self.parents_todo.append(person2_h) - fam = RelLib.Family() + fam = gen.lib.Family() self.add_defaults(fam) fam.set_father_handle(person1_h) fam.set_mother_handle(person2_h) - child_ref = RelLib.ChildRef() + child_ref = gen.lib.ChildRef() child_ref.set_reference_handle(child_h) self.fill_object(child_ref) fam.add_child_ref(child_ref) @@ -1033,9 +1033,9 @@ class TestcaseGenerator(Tool.Tool): self.fill_object( object) def rand_name( self, lastname=None, gender=None): - if gender == RelLib.Person.MALE: + if gender == gen.lib.Person.MALE: firstname = self.rand_text( self.FIRSTNAME_MALE) - elif gender == RelLib.Person.FEMALE: + elif gender == gen.lib.Person.FEMALE: firstname = self.rand_text( self.FIRSTNAME_FEMALE) else: firstname = self.rand_text( self.FIRSTNAME) @@ -1055,7 +1055,7 @@ class TestcaseGenerator(Tool.Tool): start = end - randint(0,100) year = randint(start,end) - ndate = RelLib.Date() + ndate = gen.lib.Date() if randint(0,10) == 1: # Some get a textual date ndate.set_as_text( choice((self.rand_text(self.SHORT),"Unknown","??","Don't know","TODO!"))) @@ -1065,23 +1065,23 @@ class TestcaseGenerator(Tool.Tool): pass else: # regular dates - calendar = RelLib.Date.CAL_GREGORIAN - quality = choice( (RelLib.Date.QUAL_NONE, - RelLib.Date.QUAL_ESTIMATED, - RelLib.Date.QUAL_CALCULATED)) - modifier = choice( (RelLib.Date.MOD_NONE, - RelLib.Date.MOD_BEFORE, - RelLib.Date.MOD_AFTER,\ - RelLib.Date.MOD_ABOUT, - RelLib.Date.MOD_RANGE, - RelLib.Date.MOD_SPAN)) + calendar = gen.lib.Date.CAL_GREGORIAN + quality = choice( (gen.lib.Date.QUAL_NONE, + gen.lib.Date.QUAL_ESTIMATED, + gen.lib.Date.QUAL_CALCULATED)) + modifier = choice( (gen.lib.Date.MOD_NONE, + gen.lib.Date.MOD_BEFORE, + gen.lib.Date.MOD_AFTER,\ + gen.lib.Date.MOD_ABOUT, + gen.lib.Date.MOD_RANGE, + gen.lib.Date.MOD_SPAN)) day = randint(0,28) if day > 0: # avoid days without month month = randint(1,12) else: month = randint(0,12) - if modifier in (RelLib.Date.MOD_RANGE, RelLib.Date.MOD_SPAN): + if modifier in (gen.lib.Date.MOD_RANGE, gen.lib.Date.MOD_SPAN): day2 = randint(0,28) if day2 > 0: month2 = randint(1,12) @@ -1096,68 +1096,68 @@ class TestcaseGenerator(Tool.Tool): def fill_object( self, o): - if isinstance(o,RelLib.Address): + if isinstance(o,gen.lib.Address): if randint(0,1) == 1: o.set_street( self.rand_text(self.SHORT)) - if issubclass(o.__class__,RelLib._AddressBase.AddressBase): + if issubclass(o.__class__,gen.lib._AddressBase.AddressBase): while randint(0,1) == 1: - a = RelLib.Address() + a = gen.lib.Address() self.fill_object(a) o.add_address( a) - if isinstance(o,RelLib.Attribute): - o.set_type( self.rand_type(RelLib.AttributeType())) + if isinstance(o,gen.lib.Attribute): + o.set_type( self.rand_type(gen.lib.AttributeType())) o.set_value( self.rand_text(self.SHORT)) - if issubclass(o.__class__,RelLib._AttributeBase.AttributeBase): + if issubclass(o.__class__,gen.lib._AttributeBase.AttributeBase): while randint(0,1) == 1: - a = RelLib.Attribute() + a = gen.lib.Attribute() self.fill_object(a) o.add_attribute( a) - if isinstance(o,RelLib.ChildRef): + if isinstance(o,gen.lib.ChildRef): if randint(0,3) == 1: - o.set_mother_relation( self.rand_type( RelLib.ChildRefType())) + o.set_mother_relation( self.rand_type( gen.lib.ChildRefType())) if randint(0,3) == 1: - o.set_father_relation( self.rand_type( RelLib.ChildRefType())) + o.set_father_relation( self.rand_type( gen.lib.ChildRefType())) - if issubclass(o.__class__,RelLib._DateBase.DateBase): + if issubclass(o.__class__,gen.lib._DateBase.DateBase): if randint(0,1) == 1: (y,d) = self.rand_date() o.set_date_object( d) - if isinstance(o,RelLib.Family): + if isinstance(o,gen.lib.Family): if randint(0,2) == 1: - o.set_relationship( self.rand_type(RelLib.FamilyRelType())) + o.set_relationship( self.rand_type(gen.lib.FamilyRelType())) else: - o.set_relationship(RelLib.FamilyRelType(RelLib.FamilyRelType.MARRIED)) + o.set_relationship(gen.lib.FamilyRelType(gen.lib.FamilyRelType.MARRIED)) - if isinstance(o,RelLib.LdsOrd): + if isinstance(o,gen.lib.LdsOrd): if randint(0,1) == 1: o.set_temple( choice( LdsUtils.temple_to_abrev.keys())) - if issubclass(o.__class__,RelLib._LdsOrdBase.LdsOrdBase): + if issubclass(o.__class__,gen.lib._LdsOrdBase.LdsOrdBase): while randint(0,1) == 1: - ldsord = RelLib.LdsOrd() + ldsord = gen.lib.LdsOrd() self.fill_object( ldsord) # TODO: adapt type and status to family/person - #if isinstance(o,RelLib.Person): - #if isinstance(o,RelLib.Family): + #if isinstance(o,gen.lib.Person): + #if isinstance(o,gen.lib.Family): ldsord.set_type( choice( - [item[0] for item in RelLib.LdsOrd._TYPE_MAP] )) - ldsord.set_status( randint(0,len(RelLib.LdsOrd._STATUS_MAP)-1)) + [item[0] for item in gen.lib.LdsOrd._TYPE_MAP] )) + ldsord.set_status( randint(0,len(gen.lib.LdsOrd._STATUS_MAP)-1)) if self.generated_families: ldsord.set_family_handle( choice(self.generated_families)) o.add_lds_ord( ldsord) - if isinstance(o,RelLib.Location): + if isinstance(o,gen.lib.Location): if randint(0,1) == 1: o.set_parish( self.rand_text(self.SHORT)) if randint(0,1) == 1: o.set_county( self.rand_text(self.SHORT)) - if issubclass(o.__class__,RelLib._LocationBase.LocationBase): + if issubclass(o.__class__,gen.lib._LocationBase.LocationBase): if randint(0,1) == 1: o.set_phone( self.rand_text(self.SHORT)) if randint(0,1) == 1: @@ -1169,11 +1169,11 @@ class TestcaseGenerator(Tool.Tool): if randint(0,1) == 1: o.set_postal_code( self.rand_text(self.SHORT)) - if issubclass(o.__class__,RelLib._MediaBase.MediaBase): + if issubclass(o.__class__,gen.lib._MediaBase.MediaBase): while randint(0,1) == 1: - o.add_media_reference( self.fill_object( RelLib.MediaRef())) + o.add_media_reference( self.fill_object( gen.lib.MediaRef())) - if isinstance(o,RelLib.MediaObject): + if isinstance(o,gen.lib.MediaObject): if randint(0,3) == 1: o.set_description( self.rand_text(self.LONG)) else: @@ -1181,9 +1181,9 @@ class TestcaseGenerator(Tool.Tool): o.set_path("/tmp/TestcaseGenerator.png") o.set_mime_type("image/png") - if isinstance(o,RelLib.MediaRef): + if isinstance(o,gen.lib.MediaRef): if not self.generated_media or randint(0,10) == 1: - m = RelLib.MediaObject() + m = gen.lib.MediaObject() self.fill_object(m) self.db.add_object( m, self.trans) self.generated_media.append( m.get_handle()) @@ -1191,56 +1191,56 @@ class TestcaseGenerator(Tool.Tool): if randint(0,1) == 1: o.set_rectangle( (randint(0,200),randint(0,200),randint(0,200),randint(0,200))) - if isinstance(o,RelLib.Name): - o.set_type( self.rand_type( RelLib.NameType())) + if isinstance(o,gen.lib.Name): + o.set_type( self.rand_type( gen.lib.NameType())) - if isinstance(o,RelLib.Note): + if isinstance(o,gen.lib.Note): o.set( self.rand_text(self.NOTE)) - o.set_format( choice( (RelLib.Note.FLOWED,RelLib.Note.FORMATTED))) - o.set_type( self.rand_type(RelLib.NoteType())) + o.set_format( choice( (gen.lib.Note.FLOWED,gen.lib.Note.FORMATTED))) + o.set_type( self.rand_type(gen.lib.NoteType())) - if issubclass(o.__class__,RelLib._NoteBase.NoteBase): + if issubclass(o.__class__,gen.lib._NoteBase.NoteBase): while randint(0,1) == 1: if not self.generated_notes or randint(0,10) == 1: - n = RelLib.Note() + n = gen.lib.Note() self.fill_object(n) self.db.add_note( n, self.trans) self.generated_notes.append( n.get_handle()) n_h = choice(self.generated_notes) o.add_note(n_h) - if isinstance(o,RelLib.Place): + if isinstance(o,gen.lib.Place): o.set_title( self.rand_text(self.SHORT)) if randint(0,1) == 1: o.set_longitude( self.rand_text(self.SHORT)) if randint(0,1) == 1: o.set_latitude( self.rand_text(self.SHORT)) - o.set_main_location( self.fill_object( RelLib.Location())) + o.set_main_location( self.fill_object( gen.lib.Location())) while randint(0,1) == 1: - o.add_alternate_locations( self.fill_object( RelLib.Location())) + o.add_alternate_locations( self.fill_object( gen.lib.Location())) - if issubclass(o.__class__,RelLib._PrivacyBase.PrivacyBase): + if issubclass(o.__class__,gen.lib._PrivacyBase.PrivacyBase): o.set_privacy( randint(0,5) == 1) - if issubclass(o.__class__,RelLib.PrimaryObject): - o.set_marker( self.rand_type(RelLib.MarkerType())) + if issubclass(o.__class__,gen.lib.PrimaryObject): + o.set_marker( self.rand_type(gen.lib.MarkerType())) - if isinstance(o,RelLib.RepoRef): + if isinstance(o,gen.lib.RepoRef): if not self.generated_repos or randint(0,10) == 1: - r = RelLib.Repository() + r = gen.lib.Repository() self.fill_object(r) self.db.add_repository( r, self.trans) self.generated_repos.append(r.get_handle()) o.set_reference_handle( choice( self.generated_repos)) if randint(0,1) == 1: o.set_call_number( self.rand_text(self.SHORT)) - o.set_media_type( self.rand_type(RelLib.SourceMediaType())) + o.set_media_type( self.rand_type(gen.lib.SourceMediaType())) - if isinstance(o,RelLib.Repository): - o.set_type( self.rand_type(RelLib.RepositoryType())) + if isinstance(o,gen.lib.Repository): + o.set_type( self.rand_type(gen.lib.RepositoryType())) o.set_name( self.rand_text(self.SHORT)) - if isinstance(o,RelLib.Source): + if isinstance(o,gen.lib.Source): o.set_title( self.rand_text(self.SHORT)) if randint(0,1) == 1: o.set_author( self.rand_text(self.SHORT)) @@ -1251,19 +1251,19 @@ class TestcaseGenerator(Tool.Tool): while randint(0,1) == 1: o.set_data_item( self.rand_text(self.SHORT), self.rand_text(self.SHORT)) while randint(0,1) == 1: - r = RelLib.RepoRef() + r = gen.lib.RepoRef() self.fill_object(r) o.add_repo_reference( r) - if issubclass(o.__class__,RelLib._SourceBase.SourceBase): + if issubclass(o.__class__,gen.lib._SourceBase.SourceBase): while randint(0,1) == 1: - s = RelLib.SourceRef() + s = gen.lib.SourceRef() self.fill_object(s) o.add_source_reference( s) - if isinstance(o,RelLib.SourceRef): + if isinstance(o,gen.lib.SourceRef): if not self.generated_sources or randint(0,10) == 1: - s = RelLib.Source() + s = gen.lib.Source() self.fill_object(s) self.db.add_source( s, self.trans) self.generated_sources.append( s.get_handle()) @@ -1277,35 +1277,35 @@ class TestcaseGenerator(Tool.Tool): o.set_date_object( d) o.set_confidence_level(choice(Utils.confidence.keys())) - if issubclass(o.__class__,RelLib._UrlBase.UrlBase): + if issubclass(o.__class__,gen.lib._UrlBase.UrlBase): while randint(0,1) == 1: - u = RelLib.Url() + u = gen.lib.Url() self.fill_object(u) o.add_url(u) - if isinstance(o,RelLib.Url): + if isinstance(o,gen.lib.Url): o.set_path("http://www.gramps-project.org/?test=%s" % self.rand_text(self.SHORT)) o.set_description( self.rand_text(self.SHORT)) - o.set_type( self.rand_type(RelLib.UrlType())) + o.set_type( self.rand_type(gen.lib.UrlType())) return o def rand_personal_event( self, type=None, start=None, end=None): if type: - typeval = RelLib.EventType(type) + typeval = gen.lib.EventType(type) else: - typeval = self.rand_type(RelLib.EventType()) + typeval = self.rand_type(gen.lib.EventType()) return self._rand_event( typeval, start, end) def rand_family_event( self, type=None, start=None, end=None): if type: - typeval = RelLib.EventType(type) + typeval = gen.lib.EventType(type) else: - typeval = self.rand_type(RelLib.EventType()) + typeval = self.rand_type(gen.lib.EventType()) return self._rand_event( typeval, start, end) def _rand_event( self, type, start, end): - e = RelLib.Event() + e = gen.lib.Event() self.fill_object(e) e.set_type( type) #if randint(0,1) == 1: @@ -1318,13 +1318,13 @@ class TestcaseGenerator(Tool.Tool): e.set_date_object( d) event_h = self.db.add_event(e, self.trans) self.generated_events.append(event_h) - event_ref = RelLib.EventRef() + event_ref = gen.lib.EventRef() self.fill_object(event_ref) event_ref.set_reference_handle(event_h) return (year, event_ref) def rand_type( self, list): - if issubclass( list.__class__, RelLib.GrampsType): + if issubclass( list.__class__, gen.lib.GrampsType): map = list.get_map() key = choice( map.keys()) if key == list.get_custom(): @@ -1336,7 +1336,7 @@ class TestcaseGenerator(Tool.Tool): def rand_place( self): if not self.generated_places or randint(0,10) == 1: - place = RelLib.Place() + place = gen.lib.Place() self.fill_object( place) self.db.add_place( place, self.trans) self.generated_places.append( place.get_handle()) diff --git a/src/plugins/Verify.py b/src/plugins/Verify.py index cf05e69a7..ac342c86d 100644 --- a/src/plugins/Verify.py +++ b/src/plugins/Verify.py @@ -50,7 +50,7 @@ import gtk.glade # #------------------------------------------------------------------------ import const -import RelLib +import gen.lib import Utils import GrampsDisplay from ManagedWindow import ManagedWindow @@ -122,10 +122,10 @@ def get_date_from_event_type(db,person,event_type): return 0 def get_bapt_date(db,person): - return get_date_from_event_type(db,person,RelLib.EventType.BAPTISM) + return get_date_from_event_type(db,person,gen.lib.EventType.BAPTISM) def get_bury_date(db,person): - return get_date_from_event_type(db,person,RelLib.EventType.BURIAL) + return get_date_from_event_type(db,person,gen.lib.EventType.BURIAL) def get_birth_date(db,person,estimate=False): if not person: @@ -194,7 +194,7 @@ def get_marriage_date(db,family): return 0 for event_ref in family.get_event_ref_list(): event = find_event(db,event_ref.ref) - if event.get_type() == RelLib.EventType.MARRIAGE: + if event.get_type() == gen.lib.EventType.MARRIAGE: date_obj = event.get_date_object() return date_obj.get_sort_value() return 0 @@ -941,8 +941,8 @@ class UnknownGender(PersonRule): ID = 8 SEVERITY = Rule.WARNING def broken(self): - female = self.obj.get_gender() == RelLib.Person.FEMALE - male = self.obj.get_gender() == RelLib.Person.MALE + female = self.obj.get_gender() == gen.lib.Person.FEMALE + male = self.obj.get_gender() == gen.lib.Person.MALE return not (male or female) def get_message(self): @@ -1008,11 +1008,11 @@ class TooManyChildren(PersonRule): def broken(self): n_child = get_n_children(self.db,self.obj) - if (self.obj.get_gender == RelLib.Person.MALE) \ + if (self.obj.get_gender == gen.lib.Person.MALE) \ and (n_child > self.mx_child_dad): return True - if (self.obj.get_gender == RelLib.Person.FEMALE) \ + if (self.obj.get_gender == gen.lib.Person.FEMALE) \ and (n_child > self.mx_child_mom): return True @@ -1030,7 +1030,7 @@ class SameSexFamily(FamilyRule): same_sex = (mother and father and (mother.get_gender() == father.get_gender())) unknown_sex = (mother and - (mother.get_gender() == RelLib.Person.UNKNOWN)) + (mother.get_gender() == gen.lib.Person.UNKNOWN)) return (same_sex and not unknown_sex) def get_message(self): @@ -1041,7 +1041,7 @@ class FemaleHusband(FamilyRule): SEVERITY = Rule.WARNING def broken(self): father = get_father(self.db,self.obj) - return (father and (father.get_gender() == RelLib.Person.FEMALE)) + return (father and (father.get_gender() == gen.lib.Person.FEMALE)) def get_message(self): return _("Female husband") @@ -1051,7 +1051,7 @@ class MaleWife(FamilyRule): SEVERITY = Rule.WARNING def broken(self): mother = get_mother(self.db,self.obj) - return (mother and (mother.get_gender() == RelLib.Person.MALE)) + return (mother and (mother.get_gender() == gen.lib.Person.MALE)) def get_message(self): return _("Male wife") diff --git a/src/plugins/WebCal.py b/src/plugins/WebCal.py index 9baecc2f1..a449afbbe 100644 --- a/src/plugins/WebCal.py +++ b/src/plugins/WebCal.py @@ -68,7 +68,7 @@ import gtk # GRAMPS module # #------------------------------------------------------------------------ -import RelLib +import gen.lib import const import BaseDoc from GrampsCfg import get_researcher @@ -197,7 +197,7 @@ class WebReport(Report): married_name = None names = [primary_name] + person.get_alternate_names() for n in names: - if int(n.get_type()) == RelLib.NameType.MARRIED: + if int(n.get_type()) == gen.lib.NameType.MARRIED: married_name = n # Now, decide which to use: if maiden_name != None: @@ -588,7 +588,7 @@ class WebReport(Report): # add some things to handle maiden name: father_lastname = None # husband, actually if self.Surname == 0: # get husband's last name: - if person.get_gender() == RelLib.Person.FEMALE: + if person.get_gender() == gen.lib.Person.FEMALE: family_list = person.get_family_handle_list() if len(family_list) > 0: fhandle = family_list[0] # first is primary @@ -623,9 +623,9 @@ class WebReport(Report): married = True for event_ref in fam.get_event_ref_list(): event = self.database.get_event_from_handle(event_ref.ref) - if event and int(event.get_type()) in [RelLib.EventType.DIVORCE, - RelLib.EventType.ANNULMENT, - RelLib.EventType.DIV_FILING]: + if event and int(event.get_type()) in [gen.lib.EventType.DIVORCE, + gen.lib.EventType.ANNULMENT, + gen.lib.EventType.DIV_FILING]: married = False if married: for event_ref in fam.get_event_ref_list(): diff --git a/src/plugins/WriteGeneWeb.py b/src/plugins/WriteGeneWeb.py index 27fde011f..1a8a3c4cd 100644 --- a/src/plugins/WriteGeneWeb.py +++ b/src/plugins/WriteGeneWeb.py @@ -51,7 +51,7 @@ log = logging.getLogger(".WriteGeneWeb") # GRAMPS modules # #------------------------------------------------------------------------- -import RelLib +import gen.lib from Filters import GenericFilter, Rules, build_filter_menu import const import Utils @@ -312,17 +312,17 @@ class GeneWebWriter: event_ref_list = family.get_event_ref_list() for event_ref in event_ref: event = self.db.get_event_from_handle(event_ref.ref) - if int(event.get_type()) == RelLib.EventType.MARRIAGE: + if int(event.get_type()) == gen.lib.EventType.MARRIAGE: w_list = event.get_witness_list() if w_list: for witness in w_list: - if witness and witness.type == RelLib.Event.ID: + if witness and witness.type == gen.lib.Event.ID: person = self.db.get_person_from_handle(witness.get_value()) if person: gender = "" - if person.get_gender() == RelLib.Person.MALE: + if person.get_gender() == gen.lib.Person.MALE: gender = "h" - elif person.get_gender() == RelLib.Person.FEMALE: + elif person.get_gender() == gen.lib.Person.FEMALE: gender = "f" self.writeln("wit %s %s %s" % (gender, self.get_ref_name(person), self.get_full_person_info_fam(person))) @@ -348,9 +348,9 @@ class GeneWebWriter: child = self.db.get_person_from_handle(child_ref.ref) if child: gender = "" - if child.get_gender() == RelLib.Person.MALE: + if child.get_gender() == gen.lib.Person.MALE: gender = "h" - elif child.get_gender() == RelLib.Person.FEMALE: + elif child.get_gender() == gen.lib.Person.FEMALE: gender = "f" self.writeln("- %s %s %s" % (gender, self.get_child_ref_name(child, father_lastname), self.get_full_person_info_child(child))) self.writeln("end") @@ -371,11 +371,11 @@ class GeneWebWriter: ## event_ref_list = family.get_event_ref_list() ## for event_ref in event_ref_list: ## event = self.db.get_event_from_handle(event_ref.ref) -## if int(event.get_type()) == RelLib.EventType.MARRIAGE: +## if int(event.get_type()) == gen.lib.EventType.MARRIAGE: ## w_list = event.get_witness_list() ## if w_list: ## for witness in w_list: -## if witness and witness.type == RelLib.Event.ID: +## if witness and witness.type == gen.lib.Event.ID: ## person = self.db.get_person_from_handle(witness.get_value()) ## if person: ## self.write_note_of_person(person) @@ -504,7 +504,7 @@ class GeneWebWriter: divorced = 0 for event_ref in event_ref_list: event = self.db.get_event_from_handle(event_ref.ref) - if event.get_type() == RelLib.EventType.MARRIAGE: + if event.get_type() == gen.lib.EventType.MARRIAGE: married = 1 m_date = self.format_date( event.get_date_object()) place_handle = event.get_place_handle() @@ -512,7 +512,7 @@ class GeneWebWriter: place = self.db.get_place_from_handle(place_handle) m_place = place.get_title() m_source = self.get_primary_source( event.get_source_references()) - if event.get_type() == RelLib.EventType.ENGAGEMENT: + if event.get_type() == gen.lib.EventType.ENGAGEMENT: engaged = 1 eng_date = self.format_date( event.get_date_object()) place_handle = event.get_place_handle() @@ -520,7 +520,7 @@ class GeneWebWriter: place = self.db.get_place_from_handle(place_handle) eng_place = place.get_title() eng_source = self.get_primary_source( event.get_source_references()) - if event.get_type() == RelLib.EventType.DIVORCE: + if event.get_type() == gen.lib.EventType.DIVORCE: divorced = 1 div_date = self.format_date( event.get_date_object()) if married == 1: @@ -545,7 +545,7 @@ class GeneWebWriter: if eng_source != "": ret = ret + "#ms %s " % self.rem_spaces( m_source) else: - if family.get_relationship() != RelLib.FamilyRelType.MARRIED: + if family.get_relationship() != gen.lib.FamilyRelType.MARRIED: """Not married or engaged""" ret = ret + " #nm " @@ -575,19 +575,19 @@ class GeneWebWriter: (day,month,year,sl) = subdate cal_type = "" - if cal == RelLib.Date.CAL_HEBREW: + if cal == gen.lib.Date.CAL_HEBREW: cal_type = "H" - elif cal == RelLib.Date.CAL_FRENCH: + elif cal == gen.lib.Date.CAL_FRENCH: cal_type = "F" - elif cal == RelLib.Date.CAL_JULIAN: + elif cal == gen.lib.Date.CAL_JULIAN: cal_type = "J" mode_prefix = "" - if mode == RelLib.Date.MOD_ABOUT: + if mode == gen.lib.Date.MOD_ABOUT: mode_prefix = "~" - elif mode == RelLib.Date.MOD_BEFORE: + elif mode == gen.lib.Date.MOD_BEFORE: mode_prefix = "<" - elif mode == RelLib.Date.MOD_AFTER: + elif mode == gen.lib.Date.MOD_AFTER: mode_prefix = ">" if year > 0: @@ -610,7 +610,7 @@ class GeneWebWriter: elif not date.is_empty(): mod = date.get_modifier() cal = cal = date.get_calendar() - if mod == RelLib.Date.MOD_SPAN or mod == RelLib.Date.MOD_RANGE: + if mod == gen.lib.Date.MOD_SPAN or mod == gen.lib.Date.MOD_RANGE: retval = "%s..%s" % ( self.format_single_date(date.get_start_date(), cal,mod), self.format_single_date(date.get_stop_date(),cal,mod)) diff --git a/src/plugins/lineage.py b/src/plugins/lineage.py index 5e4afc205..27bf8e653 100644 --- a/src/plugins/lineage.py +++ b/src/plugins/lineage.py @@ -31,7 +31,7 @@ Display a person's father or mother lineage # #------------------------------------------------------------------------- -import RelLib +import gen.lib from Simple import SimpleAccess, SimpleDoc from gettext import gettext as _ from PluginUtils import register_quick_report @@ -61,18 +61,18 @@ def run_father(database, document, person): sd.header2(__FMT %(_("Name Father"), _("Birth Date"), _("Death Date"))) sd.paragraph("") - make_details(RelLib.Person.MALE, person, sa, sd, database) + make_details(gen.lib.Person.MALE, person, sa, sd, database) sd.paragraph("") sd.paragraph("") - if person.gender == RelLib.Person.FEMALE : + if person.gender == gen.lib.Person.FEMALE : return sd.header2((_("Direct line male descendants"))) sd.paragraph("") - make_details_child(RelLib.Person.MALE, person, sa, sd, database) + make_details_child(gen.lib.Person.MALE, person, sa, sd, database) def run_mother(database, document, person): """ Function writing the mother lineage quick report @@ -94,18 +94,18 @@ def run_mother(database, document, person): sd.header2(__FMT %(_("Name Mother"), _("Birth"), _("Death Date"))) sd.paragraph("") - make_details(RelLib.Person.FEMALE, person, sa, sd, database) + make_details(gen.lib.Person.FEMALE, person, sa, sd, database) sd.paragraph("") sd.paragraph("") - if person.gender == RelLib.Person.MALE : + if person.gender == gen.lib.Person.MALE : return sd.header2((_("Direct line female descendants"))) sd.paragraph("") - make_details_child(RelLib.Person.FEMALE, person, sa, sd, database) + make_details_child(gen.lib.Person.FEMALE, person, sa, sd, database) def make_details(gender, person, sa, sd, database) : """ Function writing one line of ancestry on the document in @@ -141,7 +141,7 @@ def make_details(gender, person, sa, sd, database) : ref.get_father_relation()) for ref in family.get_child_ref_list() if ref.ref == person_handle] - if gender == RelLib.Person.MALE : + if gender == gen.lib.Person.MALE : person = database.get_person_from_handle( family.get_father_handle()) refnr = 1 @@ -154,11 +154,11 @@ def make_details(gender, person, sa, sd, database) : # that would complicate the code #Also, we assume the birth relation is in the FIRST # family of the person, so we go up on non-birth - if not childrel[0][refnr] == RelLib.ChildRefType.BIRTH : + if not childrel[0][refnr] == gen.lib.ChildRefType.BIRTH : rem_str = add_rem(rem_str, _("No birth relation with child")) if person and person.gender == gender : break - elif person and person.gender == RelLib.Person.UNKNOWN : + elif person and person.gender == gen.lib.Person.UNKNOWN : rem_str = add_rem(rem_str, _("Unknown gender")) break else : @@ -178,7 +178,7 @@ def make_details_child(gender, person, sa, sd, database) : raise RuntimeError #we use some global var from make_details_child ! rem_str = "" - if child.gender == RelLib.Person.UNKNOWN : + if child.gender == gen.lib.Person.UNKNOWN : rem_str = add_rem(rem_str, _("Unknown gender")) if rem_str : @@ -207,7 +207,7 @@ def make_details_child(gender, person, sa, sd, database) : fam.get_child_ref_list()] for childdet in childrel: #relation with parent must be by birth - if not childdet[childrelnr] == RelLib.ChildRefType.BIRTH : + if not childdet[childrelnr] == gen.lib.ChildRefType.BIRTH : continue newchild = database.get_person_from_handle(childdet[0]) @@ -258,4 +258,4 @@ register_quick_report( author_name="B. Malengier", author_email="benny.malengier@gramps-project.org" ) - \ No newline at end of file + diff --git a/src/plugins/rel_cs.py b/src/plugins/rel_cs.py index c1517aeb9..0c73c2cad 100644 --- a/src/plugins/rel_cs.py +++ b/src/plugins/rel_cs.py @@ -29,7 +29,7 @@ # #------------------------------------------------------------------------- -import RelLib +import gen.lib import Relationship from PluginUtils import register_relcalc @@ -175,42 +175,42 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): if firstRel == 0: if secondRel == 0: return ('',common) - elif other_person.get_gender() == RelLib.Person.MALE: + elif other_person.get_gender() == gen.lib.Person.MALE: return (self.get_father(secondRel),common) else: return (self.get_mother(secondRel),common) elif secondRel == 0: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_son(firstRel),common) else: return (self.get_daughter(firstRel),common) elif firstRel == 1: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_uncle(secondRel),common) else: return (self.get_aunt(secondRel),common) elif secondRel == 1: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_nephew(firstRel-1),common) else: return (self.get_niece(firstRel-1),common) elif firstRel == 2 and secondRel == 2: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return ('vlastní bratranec',common) else: return ('vlastní sestřenice',common) elif firstRel == 3 and secondRel == 2: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return ('bratranec druhého stupně',common) else: return ('sestřenice druhého stupně',common) elif firstRel == 2 and secondRel == 3: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return ('bratranec druhého stupně',common) else: return ('sestřenice druhého stupně',common) else: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: if firstRel+secondRel>len(_level_name)-1: return (self.get_male_cousin(firstRel+secondRel),common) else: diff --git a/src/plugins/rel_da.py b/src/plugins/rel_da.py index 2fda6b9ec..0132b4eab 100644 --- a/src/plugins/rel_da.py +++ b/src/plugins/rel_da.py @@ -30,7 +30,7 @@ # #------------------------------------------------------------------------- -import RelLib +import gen.lib import Relationship import types from gettext import gettext as _ @@ -125,7 +125,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): result.append('sønne') else: result.append('datter') - if person.get_gender() == RelLib.Person.MALE: + if person.get_gender() == gen.lib.Person.MALE: result.append('søn') else: result.append('datter') @@ -148,12 +148,12 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): result.append('sønne') else: result.append('datter') - if person.get_gender() == RelLib.Person.MALE: + if person.get_gender() == gen.lib.Person.MALE: result.append('søn') else: result.append('datter') else: - if person.get_gender() == RelLib.Person.MALE: + if person.get_gender() == gen.lib.Person.MALE: result.append('bror') else: result.append('søster') diff --git a/src/plugins/rel_de.py b/src/plugins/rel_de.py index bc09228ae..0ca248b6a 100644 --- a/src/plugins/rel_de.py +++ b/src/plugins/rel_de.py @@ -32,7 +32,7 @@ # #------------------------------------------------------------------------- -import RelLib +import gen.lib import Relationship import types from gettext import gettext as _ @@ -355,27 +355,27 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): if firstRel == 0: if secondRel == 0: return ('',common) - elif other_person.get_gender() == RelLib.Person.MALE: + elif other_person.get_gender() == gen.lib.Person.MALE: return (self.get_father(secondRel),common) else: return (self.get_mother(secondRel),common) elif secondRel == 0: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_son(firstRel),common) else: return (self.get_daughter(firstRel),common) elif secondRel > firstRel: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_uncle(secondRel-firstRel,firstRel),common) else: return (self.get_aunt(secondRel-firstRel,firstRel),common) elif secondRel < firstRel: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_nephew(firstRel-secondRel,secondRel),common) else: return (self.get_niece(firstRel-secondRel,secondRel),common) else: # obviously secondRel == firstRel - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_male_cousin(firstRel-1),common) else: return (self.get_female_cousin(firstRel-1),common) diff --git a/src/plugins/rel_es.py b/src/plugins/rel_es.py index f5b959ad7..4b8717768 100644 --- a/src/plugins/rel_es.py +++ b/src/plugins/rel_es.py @@ -29,7 +29,7 @@ # #------------------------------------------------------------------------- -import RelLib +import gen.lib import Relationship import types from gettext import gettext as _ @@ -283,47 +283,47 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): if firstRel == 0: if secondRel == 0: return ('',common) - elif other_person.get_gender() == RelLib.Person.MALE: + elif other_person.get_gender() == gen.lib.Person.MALE: return (self.get_father(secondRel),common) else: return (self.get_mother(secondRel),common) elif secondRel == 0: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_son(firstRel),common) else: return (self.get_daughter(firstRel),common) elif firstRel == 1: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_uncle(secondRel),common) else: return (self.get_aunt(secondRel),common) elif secondRel == 1: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_nephew(firstRel-1),common) else: return (self.get_niece(firstRel-1),common) elif firstRel == 2 and secondRel == 2: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return ('primo hermano',common) else: return ('prima hermana',common) elif firstRel == secondRel: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_male_cousin(firstRel-1),common) else: return (self.get_female_cousin(firstRel-1),common) elif firstRel == secondRel+1: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_distant_nephew(secondRel),common) else: return (self.get_distant_niece(secondRel),common) elif firstRel+1 == secondRel: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_distant_uncle(firstRel),common) else: return (self.get_distant_aunt(firstRel),common) else: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_male_relative(firstRel,secondRel),common) else: return (self.get_female_relative(firstRel,secondRel),common) diff --git a/src/plugins/rel_fi.py b/src/plugins/rel_fi.py index 314dfbde3..bb93af9b1 100644 --- a/src/plugins/rel_fi.py +++ b/src/plugins/rel_fi.py @@ -30,7 +30,7 @@ # #------------------------------------------------------------------------- -import RelLib +import gen.lib import Relationship import types from gettext import gettext as _ @@ -88,7 +88,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): result.append('isän') else: result.append('äidin') - if person.get_gender() == RelLib.Person.MALE: + if person.get_gender() == gen.lib.Person.MALE: result.append('isä') else: result.append('äiti') @@ -103,9 +103,9 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): result.append('tyttären') else: result.append('lapsen') - if person.get_gender() == RelLib.Person.MALE: + if person.get_gender() == gen.lib.Person.MALE: result.append('poika') - elif person.get_gender() == RelLib.Person.FEMALE: + elif person.get_gender() == gen.lib.Person.FEMALE: result.append('tytär') else: result.append('lapsi') @@ -140,9 +140,9 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): result.append('tyttären') else: result.append('lapsen') - if person.get_gender() == RelLib.Person.MALE: + if person.get_gender() == gen.lib.Person.MALE: result.append('poika') - elif person.get_gender() == RelLib.Person.FEMALE: + elif person.get_gender() == gen.lib.Person.FEMALE: result.append('tytär') else: result.append('lapsi') @@ -206,7 +206,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): elif not secondRel: return (self.get_direct_descendant(other_person,firstRel),common) elif len(firstRel) == 1: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_ancestors_brother(secondRel),common) else: return (self.get_ancestors_sister(secondRel),common) diff --git a/src/plugins/rel_fr.py b/src/plugins/rel_fr.py index 0d72dbacd..58d55e7e4 100644 --- a/src/plugins/rel_fr.py +++ b/src/plugins/rel_fr.py @@ -27,7 +27,7 @@ # #------------------------------------------------------------------------- -import RelLib +import gen.lib import Relationship import types from gettext import gettext as _ @@ -197,42 +197,42 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): if firstRel == 0: if secondRel == 0: return ('', common) - elif other_person.get_gender() == RelLib.Person.MALE: + elif other_person.get_gender() == gen.lib.Person.MALE: return (self.get_father(secondRel), common) else: return (self.get_mother(secondRel), common) elif secondRel == 0: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_son(firstRel), common) else: return (self.get_daughter(firstRel), common) elif firstRel == 1: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_uncle(secondRel), common) else: return (self.get_aunt(secondRel), common) elif secondRel == 1: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_nephew(firstRel-1), common) else: return (self.get_niece(firstRel-1), common) elif firstRel == 2 and secondRel == 2: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return ('le cousin germain', common) else: return ('la cousine germaine', common) elif firstRel == 3 and secondRel == 2: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return ('le neveu à la mode de Bretagne', common) else: return ('la nièce à la mode de Bretagne', common) elif firstRel == 2 and secondRel == 3: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return ('l\'oncle à la mode de Bretagne', common) else: return ('la tante à la mode de Bretagne', common) else: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_cousin(firstRel, secondRel), common) else: return (self.get_cousine(firstRel, secondRel), common) diff --git a/src/plugins/rel_hu.py b/src/plugins/rel_hu.py index 7217d2bc6..df46f57cd 100644 --- a/src/plugins/rel_hu.py +++ b/src/plugins/rel_hu.py @@ -30,7 +30,7 @@ # #------------------------------------------------------------------------- -import RelLib +import gen.lib import Relationship from PluginUtils import register_relcalc import types @@ -272,25 +272,25 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): return (is_spouse,[]) if self.is_fathermother_in_law(other_person,orig_person): - if other_person.getGender() == RelLib.Person.MALE: + if other_person.getGender() == gen.lib.Person.MALE: return ("apósa",self.get_fathermother_in_law_common(other_person,orig_person)) - elif other_person.getGender() == RelLib.Person.FEMALE: + elif other_person.getGender() == gen.lib.Person.FEMALE: return ("anyósa",self.get_fathermother_in_law_common(other_person,orig_person)) elif other_person.getGender() == 2 : return ("apósa vagy anyósa",self.get_fathermother_in_law_common(other_person,orig_person)) if self.is_fathermother_in_law(orig_person,other_person): - if orig_person.getGender() == RelLib.Person.MALE: + if orig_person.getGender() == gen.lib.Person.MALE: return ("veje",self.get_fathermother_in_law_common(orig_person,other_person)) - elif orig_person.getGender() == RelLib.Person.FEMALE: + elif orig_person.getGender() == gen.lib.Person.FEMALE: return ("menye",self.get_fathermother_in_law_common(orig_person,other_person)) elif orig_person.getGender() == 2 : return ("veje vagy menye",self.get_fathermother_in_law_common(orig_person,other_person)) if self.is_brothersister_in_law(orig_person,other_person): - if other_person.getGender() == RelLib.Person.MALE: + if other_person.getGender() == gen.lib.Person.MALE: return ("sógora",self.get_brothersister_in_law_common(orig_person,other_person)) - elif other_person.getGender() == RelLib.Person.FEMALE: + elif other_person.getGender() == gen.lib.Person.FEMALE: return ("sógornője",self.get_brothersister_in_law_common(orig_person,other_person)) elif other_person.getGender() == 2 : return ("sógora vagy sógornője",self.get_brothersister_in_law_common(orig_person,other_person)) @@ -313,19 +313,19 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): if firstRel == 0: if secondRel == 0: return ('',common) - elif other_person.get_gender() == RelLib.Person.MALE: + elif other_person.get_gender() == gen.lib.Person.MALE: return (self.get_father(secondRel),common) else: return (self.get_mother(secondRel),common) elif secondRel == 0: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_son(firstRel),common) else: return (self.get_daughter(firstRel),common) elif firstRel == 1: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: if secondRel == 1: return (self.get_age_brother(self.get_age_comp(orig_person,other_person)),common) else :return (self.get_uncle(secondRel),common) @@ -335,13 +335,13 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): else :return (self.get_aunt(secondRel),common) elif secondRel == 1: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_nephew(firstRel-1),common) else: return (self.get_niece(firstRel-1),common) else: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_male_cousin(firstRel-1), common) else: return (self.get_female_cousin(firstRel-1), common) diff --git a/src/plugins/rel_it.py b/src/plugins/rel_it.py index 4feaf7823..bfa9601c3 100644 --- a/src/plugins/rel_it.py +++ b/src/plugins/rel_it.py @@ -31,7 +31,7 @@ # #------------------------------------------------------------------------- -import RelLib +import gen.lib import Relationship import types from PluginUtils import register_relcalc @@ -172,27 +172,27 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): if firstRel == 0: if secondRel == 0: return ('',common) - elif other_person.get_gender() == RelLib.Person.MALE: + elif other_person.get_gender() == gen.lib.Person.MALE: return (self.get_father(secondRel),common) else: return (self.get_mother(secondRel),common) elif secondRel == 0: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_son(firstRel),common) else: return (self.get_daughter(firstRel),common) elif firstRel == 1: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_uncle(secondRel),common) else: return (self.get_aunt(secondRel),common) elif secondRel == 1: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_nephew(firstRel-1),common) else: return (self.get_niece(firstRel-1),common) else: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_male_cousin(firstRel-1, secondRel-1), common) else: return (self.get_female_cousin(firstRel-1, secondRel-1), common) diff --git a/src/plugins/rel_nl.py b/src/plugins/rel_nl.py index 2590ec524..66b7cc23b 100644 --- a/src/plugins/rel_nl.py +++ b/src/plugins/rel_nl.py @@ -27,7 +27,7 @@ # #------------------------------------------------------------------------- -import RelLib +import gen.lib import Relationship import types from gettext import gettext as _ @@ -228,42 +228,42 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): if firstRel == 0: if secondRel == 0: return ('',common) - elif other_person.get_gender() == RelLib.Person.MALE: + elif other_person.get_gender() == gen.lib.Person.MALE: return (self.get_father(secondRel),common) else: return (self.get_mother(secondRel),common) elif secondRel == 0: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_son(firstRel),common) else: return (self.get_daughter(firstRel),common) elif firstRel == 1: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_uncle(secondRel),common) else: return (self.get_aunt(secondRel),common) elif secondRel == 1: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_nephew(firstRel-1),common) else: return (self.get_niece(firstRel-1),common) elif firstRel == 2 and secondRel == 2: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return ('le cousin germain',common) else: return ('la cousine germaine',common) elif firstRel == 3 and secondRel == 2: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return ('le neveu à la mode de Bretagne',common) else: return ('la nièce à la mode de Bretagne',common) elif firstRel == 2 and secondRel == 3: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return ('l\'oncle à la mode de Bretagne',common) else: return ('la tante à la mode de Bretagne',common) else: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: if firstRel+secondRel>len(_level_name)-1: return (self.get_male_cousin(firstRel+secondRel),common) else: diff --git a/src/plugins/rel_no.py b/src/plugins/rel_no.py index 4ba6522ee..4fb76ca59 100644 --- a/src/plugins/rel_no.py +++ b/src/plugins/rel_no.py @@ -30,7 +30,7 @@ # #------------------------------------------------------------------------- -import RelLib +import gen.lib import Relationship import types from gettext import gettext as _ @@ -116,7 +116,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): result.append('sønne') else: result.append('datter') - if person.get_gender() == RelLib.Person.MALE: + if person.get_gender() == gen.lib.Person.MALE: result.append('sønn') else: result.append('datter') @@ -133,7 +133,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): result.append('mor') if level > 1: result.append(self.get_cousin(level)) - elif person.get_gender() == RelLib.Person.MALE: + elif person.get_gender() == gen.lib.Person.MALE: result.append('fetter') else: result.append('kusine') @@ -162,7 +162,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): result.append('sønn') else: result.append('datter') - if person.get_gender() == RelLib.Person.MALE: + if person.get_gender() == gen.lib.Person.MALE: result.append('sønn') else: result.append('datter') @@ -208,12 +208,12 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): result.append('sønne') else: result.append('datter') - if person.get_gender() == RelLib.Person.MALE: + if person.get_gender() == gen.lib.Person.MALE: result.append('sønn') else: result.append('datter') else: - if person.get_gender() == RelLib.Person.MALE: + if person.get_gender() == gen.lib.Person.MALE: result.append('bror') else: result.append('søster') @@ -256,7 +256,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): elif not secondRel: return (self.get_direct_descendant(other_person,firstRel),common) elif len(firstRel) == 1: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_ancestors_brother(secondRel),common) else: return (self.get_ancestors_sister(secondRel),common) diff --git a/src/plugins/rel_pl.py b/src/plugins/rel_pl.py index ab65bbf2d..40047e3af 100644 --- a/src/plugins/rel_pl.py +++ b/src/plugins/rel_pl.py @@ -27,7 +27,7 @@ # #------------------------------------------------------------------------- -import RelLib +import gen.lib import Relationship import types from gettext import gettext as _ @@ -526,12 +526,12 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): if firstRel == 0: if secondRel == 0: return ('',common) - elif other_person.get_gender() == RelLib.Person.MALE: + elif other_person.get_gender() == gen.lib.Person.MALE: return (self.get_father(secondRel,firstRel),common) else: return (self.get_mother(secondRel,firstRel),common) elif secondRel == 0: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_son(secondRel,firstRel),common) else: return (self.get_daughter(secondRel,firstRel),common) @@ -553,30 +553,30 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): if sibling.ref in firstList: # discriminate between siblings/uncles etc. and stepsiblings/stepuncles etc. if other_person.get_main_parents_family_handle() == db.get_person_from_handle(sibling.ref).get_main_parents_family_handle(): - if other_person.get_gender() == RelLib.Person.MALE: - if db.get_person_from_handle(sibling.ref).get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: + if db.get_person_from_handle(sibling.ref).get_gender() == gen.lib.Person.MALE: # brat / stryj / (pra)dziadek stryjeczny return (self.get_uncle_of_male(secondRel,firstRel),common) else: # brat / wuj / (pra)dziadek cioteczny return (self.get_uncle_of_female(secondRel,firstRel),common) else: - if db.get_person_from_handle(sibling.ref).get_gender() == RelLib.Person.MALE: + if db.get_person_from_handle(sibling.ref).get_gender() == gen.lib.Person.MALE: # siostra / ciotka / (pra)babcia stryjeczna return (self.get_aunt_of_male(secondRel,firstRel),common) else: # siostra / ciotka / (pra)babcia cioteczna return (self.get_aunt_of_female(secondRel,firstRel),common) else: - if other_person.get_gender() == RelLib.Person.MALE: - if db.get_person_from_handle(sibling.ref).get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: + if db.get_person_from_handle(sibling.ref).get_gender() == gen.lib.Person.MALE: # brat / stryj / (pra)dziadek stryjeczny return (self.get_uncle_of_male(secondRel,firstRel)+" (przyrodni)",common) else: # brat / wuj / (pra)dziadek cioteczny return (self.get_uncle_of_female(secondRel,firstRel)+" (przyrodni)",common) else: - if db.get_person_from_handle(sibling.ref).get_gender() == RelLib.Person.MALE: + if db.get_person_from_handle(sibling.ref).get_gender() == gen.lib.Person.MALE: # siostra / ciotka / (pra)babcia stryjeczna return (self.get_aunt_of_male(secondRel,firstRel)+" (przyrodnia)",common) else: @@ -604,31 +604,31 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): for child_handle in db.get_family_from_handle(sibFamily).get_child_ref_list(): if child_handle.ref in secondList: child = db.get_person_from_handle(child_handle.ref) - if other_person.get_gender() == RelLib.Person.MALE: - if sibling.get_gender() == RelLib.Person.MALE: - if child.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: + if sibling.get_gender() == gen.lib.Person.MALE: + if child.get_gender() == gen.lib.Person.MALE: # bratanek / syn bratanka return (self.get_nephew_of_brothers_son(secondRel,firstRel),common) else: # bratanek / syn bratanicy return (self.get_nephew_of_brothers_daughter(secondRel,firstRel),common) else: - if child.get_gender() == RelLib.Person.MALE: + if child.get_gender() == gen.lib.Person.MALE: # siostrzeniec / syn siostrzeńca return (self.get_nephew_of_sisters_son(secondRel,firstRel),common) else: # siostrzniec / syn siostrzenicy return (self.get_nephew_of_sisters_daughter(secondRel,firstRel),common) else: - if sibling.get_gender() == RelLib.Person.MALE: - if child.get_gender() == RelLib.Person.MALE: + if sibling.get_gender() == gen.lib.Person.MALE: + if child.get_gender() == gen.lib.Person.MALE: # bratanica / córka bratanka return (self.get_niece_of_brothers_son(secondRel,firstRel),common) else: # bratanica / córka bratanicy return (self.get_niece_of_brothers_daughter(secondRel,firstRel),common) else: - if child.get_gender() == RelLib.Person.MALE: + if child.get_gender() == gen.lib.Person.MALE: # siostrzenica / córka siostrzeńca return (self.get_niece_of_sisters_son(secondRel,firstRel),common) else: @@ -650,13 +650,13 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): children = ancFamily.get_child_ref_list() for sibling in children: if sibling.ref in firstList: - if other_person.get_gender() == RelLib.Person.MALE: - if db.get_person_from_handle(sibling.ref).get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: + if db.get_person_from_handle(sibling.ref).get_gender() == gen.lib.Person.MALE: return (self.get_senior_male_cousin_of_male(secondRel-firstRel+1,firstRel,secondRel),common) else: return (self.get_senior_male_cousin_of_female(secondRel-firstRel+1,firstRel,secondRel),common) else: - if db.get_person_from_handle(sibling.ref).get_gender() == RelLib.Person.MALE: + if db.get_person_from_handle(sibling.ref).get_gender() == gen.lib.Person.MALE: return (self.get_senior_female_cousin_of_male(secondRel-firstRel+1,firstRel,secondRel),common) else: return (self.get_senior_female_cousin_of_female(secondRel-firstRel+1,firstRel,secondRel),common) @@ -681,9 +681,9 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): if other_sibling_handle.ref in secondList: sibling = db.get_person_from_handle(sibling_handle.ref) other_sibling = db.get_person_from_handle(other_sibling_handle.ref) - if other_person.get_gender() == RelLib.Person.MALE: - if other_sibling.get_gender() == RelLib.Person.MALE: - if sibling.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: + if other_sibling.get_gender() == gen.lib.Person.MALE: + if sibling.get_gender() == gen.lib.Person.MALE: # brat stryjeczny return (self.get_junior_male_cousin_father_uncle(secondRel,firstRel),common) else: @@ -693,8 +693,8 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): # brat cioteczny return (self.get_junior_male_cousin_aunt(secondRel,firstRel),common) else: - if other_sibling.get_gender() == RelLib.Person.MALE: - if sibling.get_gender() == RelLib.Person.MALE: + if other_sibling.get_gender() == gen.lib.Person.MALE: + if sibling.get_gender() == gen.lib.Person.MALE: # siostra stryjeczna return (self.get_junior_female_cousin_father_uncle(secondRel,firstRel),common) else: @@ -711,4 +711,4 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): #------------------------------------------------------------------------- register_relcalc(RelationshipCalculator, ["pl","PL","pl_PL","polski","Polski","pl_PL.UTF-8", "pl_PL.UTF8", "pl_PL.utf-8", "pl_PL.utf8", "pl_PL.iso-8859-2", "pl_PL.iso8859-2", "pl_PL.cp1250", "pl_PL.cp-1250"]) - \ No newline at end of file + diff --git a/src/plugins/rel_ru.py b/src/plugins/rel_ru.py index 1a76df0c7..d1714c5ef 100644 --- a/src/plugins/rel_ru.py +++ b/src/plugins/rel_ru.py @@ -29,7 +29,7 @@ # #------------------------------------------------------------------------- -import RelLib +import gen.lib import Relationship import types from PluginUtils import register_relcalc @@ -228,32 +228,32 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): if firstRel == 0: if secondRel == 0: return ('',common) - elif other_person.get_gender() == RelLib.Person.MALE: + elif other_person.get_gender() == gen.lib.Person.MALE: return (self.get_father(secondRel),common) else: return (self.get_mother(secondRel),common) elif secondRel == 0: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_son(firstRel),common) else: return (self.get_daughter(firstRel),common) elif firstRel == 1: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_uncle(secondRel),common) else: return (self.get_aunt(secondRel),common) elif secondRel == 1: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_nephew(firstRel-1),common) else: return (self.get_niece(firstRel-1),common) elif secondRel > firstRel: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_senior_male_cousin(firstRel-1,secondRel-firstRel),common) else: return (self.get_senior_female_cousin(firstRel-1,secondRel-firstRel),common) else: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_junior_male_cousin(secondRel-1,firstRel-secondRel),common) else: return (self.get_junior_female_cousin(secondRel-1,firstRel-secondRel),common) diff --git a/src/plugins/rel_sk.py b/src/plugins/rel_sk.py index c2e51016e..e1378c832 100644 --- a/src/plugins/rel_sk.py +++ b/src/plugins/rel_sk.py @@ -28,7 +28,7 @@ # #------------------------------------------------------------------------- -import RelLib +import gen.lib import Relationship import types from PluginUtils import register_relcalc @@ -176,42 +176,42 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): if firstRel == 0: if secondRel == 0: return ('',common) - elif other_person.get_gender() == RelLib.Person.MALE: + elif other_person.get_gender() == gen.lib.Person.MALE: return (self.get_father(secondRel),common) else: return (self.get_mother(secondRel),common) elif secondRel == 0: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_son(firstRel),common) else: return (self.get_daughter(firstRel),common) elif firstRel == 1: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_uncle(secondRel),common) else: return (self.get_aunt(secondRel),common) elif secondRel == 1: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_nephew(firstRel-1),common) else: return (self.get_niece(firstRel-1),common) elif firstRel == 2 and secondRel == 2: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return ('vlastný bratranec',common) else: return ('vlastná sesternica',common) elif firstRel == 3 and secondRel == 2: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return ('bratranec druhého stupňa',common) else: return ('sesternica druhého stupňa',common) elif firstRel == 2 and secondRel == 3: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return ('bratranec druhého stupňa',common) else: return ('sesternica druhého stupňa',common) else: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: if firstRel+secondRel>len(_level_name)-1: return (self.get_male_cousin(firstRel+secondRel),common) else: diff --git a/src/plugins/rel_sv.py b/src/plugins/rel_sv.py index ec2931d5f..71752a052 100644 --- a/src/plugins/rel_sv.py +++ b/src/plugins/rel_sv.py @@ -30,7 +30,7 @@ # #------------------------------------------------------------------------- -import RelLib +import gen.lib import Relationship import types from gettext import gettext as _ @@ -115,7 +115,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): result.append('son') else: result.append('dotter') - if person.get_gender() == RelLib.Person.MALE: + if person.get_gender() == gen.lib.Person.MALE: result.append('son') else: result.append('dotter') @@ -148,7 +148,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): result.append('son') else: result.append('dotter') - if person.get_gender() == RelLib.Person.MALE: + if person.get_gender() == gen.lib.Person.MALE: result.append('son') else: result.append('dotter') @@ -211,7 +211,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator): elif not secondRel: return (self.get_direct_descendant(other_person,firstRel),common) elif len(firstRel) == 1: - if other_person.get_gender() == RelLib.Person.MALE: + if other_person.get_gender() == gen.lib.Person.MALE: return (self.get_ancestors_brother(secondRel),common) else: return (self.get_ancestors_sister(secondRel),common)