2006-04-19 Don Allingham <don@gramps-project.org>

* src/DataViews/_EventView.py: more GrampsTypes changes
	* src/DataViews/_PedigreeView.py: more GrampsTypes changes
	* src/RelLib/_ChildRef.py: more GrampsTypes changes
	* src/RelLib/_Family.py: more GrampsTypes changes
	* src/RelLib/_Repository.py: more GrampsTypes changes
	* src/RelLib/_Event.py: more GrampsTypes changes
	* src/Editors/_EditPerson.py: more GrampsTypes changes
	* src/Editors/_EditEventRef.py: more GrampsTypes changes
	* src/Editors/_EditEvent.py: more GrampsTypes changes
	* src/PeopleModel.py: more GrampsTypes changes
	* src/DisplayTabs.py: more GrampsTypes changes
	* src/GrampsWidgets.py: more GrampsTypes changes
	* src/Utils.py: more GrampsTypes changes
	* src/PageView.py: more GrampsTypes changes



svn: r6373
This commit is contained in:
Don Allingham
2006-04-20 03:10:23 +00:00
parent cd5518015b
commit bd7b3136e8
15 changed files with 51 additions and 246 deletions

View File

@@ -88,7 +88,7 @@ class ChildRef(BaseObject,PrivacyBase,SourceBase,NoteBase,RefBase):
@return: Returns the list of all textual attributes of the object.
@rtype: list
"""
return [self.rel, str(self.frel), str(mrel)]
return [str(self.frel), str(self.mrel)]
def get_text_data_child_list(self):
"""

View File

@@ -206,7 +206,7 @@ class Event(PrimaryObject,SourceBase,NoteBase,MediaBase,DateBase,PlaceBase):
description = self.description
cause = self.cause
the_type = self.type
return (the_type == Event.CUSTOM and date.is_empty()
return (the_type == EventType.CUSTOM and date.is_empty()
and not place and not description and not cause)
def are_equal(self,other):
@@ -238,23 +238,6 @@ class Event(PrimaryObject,SourceBase,NoteBase,MediaBase,DateBase,PlaceBase):
return True
def set_name(self,name):
warn( "Use set_type instead of set_name", DeprecationWarning, 2)
# INCOMPLETE Wrapper for old API
# remove when transitition done.
if name in range(-1,45):
the_type = (name,'')
else:
the_type = (Event.CUSTOM,name)
self.set_type(the_type)
def get_name(self):
warn( "Use get_type instead of get_name", DeprecationWarning, 2)
# INCOMPLETE Wrapper for old API
# remove when transitition done.
type = self.get_type()
return type[1]
def set_type(self,the_type):
"""
Sets the type of the Event to the passed (int,str) tuple.

View File

@@ -92,7 +92,6 @@ class Family(PrimaryObject,SourceBase,NoteBase,MediaBase,AttributeBase,
self.child_ref_list = []
self.type = FamilyRelType()
self.event_ref_list = []
self.lds_seal = None
self.complete = 0
def serialize(self):
@@ -111,10 +110,6 @@ class Family(PrimaryObject,SourceBase,NoteBase,MediaBase,AttributeBase,
be considered persistent.
@rtype: tuple
"""
if self.lds_seal == None:
lds_seal = None
else:
lds_seal = self.lds_seal.serialize()
return (self.handle, self.gramps_id, self.father_handle,
self.mother_handle,
[cr.serialize() for cr in self.child_ref_list],
@@ -153,7 +148,7 @@ class Family(PrimaryObject,SourceBase,NoteBase,MediaBase,AttributeBase,
if classname == 'Event':
return handle in [ref.ref for ref in self.event_ref_list]
elif classname == 'Person':
return handle in ([ref.ref for ref in self.child_list]
return handle in ([ref.ref for ref in self.child_ref_list]
+ [self.father_handle,self.mother_handle])
elif classname == 'Place':
return handle in [ x.place for x in self.lds_ord_list ]
@@ -381,7 +376,7 @@ class Family(PrimaryObject,SourceBase,NoteBase,MediaBase,AttributeBase,
in the list.
@rtype: bool
"""
if not isinstance(childref,ChildRef):
if not isinstance(child_ref,ChildRef):
raise ValueError("expecting ChildRef instance")
new_list = [ref for ref in self.child_ref_list
if ref.ref != child_ref.ref ]

View File

@@ -141,7 +141,7 @@ class Repository(PrimaryObject,NoteBase,AddressBase,UrlBase):
@type type: str
"""
if type(the_type) == tuple:
self.type = NameType(the_type)
self.type = RepositoryType(the_type)
else:
self.type = the_type