From a71ac389b26d7e24f9a6c5ab9c6c149d6fc500b5 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Thu, 20 Apr 2006 03:34:07 +0000 Subject: [PATCH] type changes svn: r6375 --- src/DisplayTabs.py | 4 ++-- src/GenericFilter.py | 2 +- src/GrampsDb/_ReadXML.py | 8 ++++---- src/RelLib/Makefile.am | 1 + src/RelLib/_Person.py | 2 +- src/SubstKeywords.py | 2 +- src/Utils.py | 6 +++--- src/plugins/Verify.py | 4 ++-- 8 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/DisplayTabs.py b/src/DisplayTabs.py index a319f9322..562d5b38b 100644 --- a/src/DisplayTabs.py +++ b/src/DisplayTabs.py @@ -764,9 +764,9 @@ class PersonEventEmbedList(EventEmbedList): for ref in self.orig_data: event = self.dbstate.db.get_event_from_handle(ref.ref) - if birth_ref == None and int(event.get_type()) == RelLib.EventType.BIRTH: + if birth_ref == None and event.get_type() == RelLib.EventType.BIRTH: birth_ref = ref - elif death_ref == None and int(event.get_type()) == RelLib.EventType.DEATH: + elif death_ref == None and event.get_type() == RelLib.EventType.DEATH: death_ref = ref else: new_list.append(ref) diff --git a/src/GenericFilter.py b/src/GenericFilter.py index 92ca0ba44..78544a4a4 100644 --- a/src/GenericFilter.py +++ b/src/GenericFilter.py @@ -1649,7 +1649,7 @@ class IsWitness(Rule): wlist = event.get_witness_list() if wlist: for w in wlist: - if int(w.get_type()) == RelLib.Event.ID: + if w.get_type() == RelLib.Event.ID: self.map.append(w.get_value()) diff --git a/src/GrampsDb/_ReadXML.py b/src/GrampsDb/_ReadXML.py index c05b9e87f..66a29b8e1 100644 --- a/src/GrampsDb/_ReadXML.py +++ b/src/GrampsDb/_ReadXML.py @@ -776,9 +776,9 @@ class GrampsParser: self.family.add_event_ref(self.eventref) elif self.person: event.personal = True - if int(event.type) == RelLib.EventType.BIRTH: + if event.type == RelLib.EventType.BIRTH: self.person.birth_ref = self.eventref - elif int(event.type) == RelLib.EventType.DEATH: + elif event.type == RelLib.EventType.DEATH: self.person.death_ref = self.eventref else: self.person.add_event_ref(self.eventref) @@ -1409,9 +1409,9 @@ class GrampsParser: ref.ref = self.event.handle ref.private = self.event.private ref.role.set(RelLib.EventRoleType.PRIMARY) - if int(self.event.type) == RelLib.EventType.BIRTH: + if self.event.type == RelLib.EventType.BIRTH: self.person.birth_ref = ref - elif int(self.event.type) == RelLib.EventType.DEATH: + elif self.event.type == RelLib.EventType.DEATH: self.person.death_ref = ref else: self.person.add_event_ref(ref) diff --git a/src/RelLib/Makefile.am b/src/RelLib/Makefile.am index 9293160ea..95e3c8dbf 100644 --- a/src/RelLib/Makefile.am +++ b/src/RelLib/Makefile.am @@ -41,6 +41,7 @@ pkgdata_PYTHON = \ _PrivateSourceNote.py\ _RepoRef.py\ _Repository.py\ + _RepositoryType.py\ _Researcher.py\ _SourceNote.py\ _Source.py\ diff --git a/src/RelLib/_Person.py b/src/RelLib/_Person.py index a0636f4cc..965a0c5d2 100644 --- a/src/RelLib/_Person.py +++ b/src/RelLib/_Person.py @@ -353,7 +353,7 @@ class Person(PrimaryObject,SourceBase,NoteBase,MediaBase, DeprecationWarning, 2) # Wrapper for old API # remove when transitition done. - return int(self.marker) == MarkerType.COMPLETE + return self.marker == MarkerType.COMPLETE def set_primary_name(self, name): """ diff --git a/src/SubstKeywords.py b/src/SubstKeywords.py index 3205f0f8c..d4516e85f 100644 --- a/src/SubstKeywords.py +++ b/src/SubstKeywords.py @@ -118,7 +118,7 @@ class SubstKeywords: if not e_ref: continue e = database.get_event_from_handle(e_ref.ref) - if int(e.get_type()) == RelLib.EventType.MARRIAGE: + if e.get_type() == RelLib.EventType.MARRIAGE: self.m = DateHandler.get_date(e) mplace_handle = e.get_place_handle() if mplace_handle: diff --git a/src/Utils.py b/src/Utils.py index 5a37ae389..197f78782 100644 --- a/src/Utils.py +++ b/src/Utils.py @@ -676,9 +676,9 @@ 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.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 [RelLib.EventType.CAUSE_DEATH, + RelLib.EventType.BURIAL, + RelLib.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: diff --git a/src/plugins/Verify.py b/src/plugins/Verify.py index bf80643fc..a3f2fdc20 100644 --- a/src/plugins/Verify.py +++ b/src/plugins/Verify.py @@ -244,9 +244,9 @@ class Verify(Tool.Tool, ManagedWindow.ManagedWindow): if event_ref: event_handle = event_ref.ref event = self.db.get_event_from_handle(event_handle) - if int(event.get_type()) == RelLib.EventType.BURIAL: + if event.get_type() == RelLib.EventType.BURIAL: buryear = self.get_year( event.get_handle() ) - elif int(event.get_type()) == RelLib.EventType.BAPTISM: + elif event.get_type() == RelLib.EventType.BAPTISM: bapyear = self.get_year( event.get_handle() ) if byear>0 and bapyear>0: