* src/GrampsDb/_GrampsBSDDB.py: Upgrade to new types.
* src/GrampsDb/_ReadGedcom.py: Adapt to new types. * src/RelLib/_Event.py: Properly set type. * src/RelLib/_EventRef.py: Properly set type. * src/RelLib/_Family.py: Properly set type. * src/RelLib/_Name.py: Properly set type. * src/RelLib/_Person.py: Properly set type. * src/RelLib/_PrimaryObject.py: Properly set type. * src/RelLib/_RepoRef.py: Properly set type. * src/RelLib/_Repository.py: Properly set type. * src/RelLib/_Url.py: Properly set type. svn: r6386
This commit is contained in:
@@ -245,10 +245,7 @@ class Event(PrimaryObject,SourceBase,NoteBase,MediaBase,DateBase,PlaceBase):
|
||||
@param the_type: Type to assign to the Event
|
||||
@type the_type: tuple
|
||||
"""
|
||||
if type(the_type) == tuple:
|
||||
self.type = EventType(the_type)
|
||||
else:
|
||||
self.type = the_type
|
||||
self.type.set(the_type)
|
||||
|
||||
def get_type(self):
|
||||
"""
|
||||
|
||||
@@ -127,7 +127,4 @@ class EventRef(BaseObject,PrivacyBase,NoteBase,RefBase):
|
||||
"""
|
||||
Sets the role according to the given argument.
|
||||
"""
|
||||
if type(role) == tuple:
|
||||
self.role = EventRoleType(role)
|
||||
else:
|
||||
self.role = role
|
||||
self.role.set(role)
|
||||
|
||||
@@ -45,7 +45,6 @@ from _EventRef import EventRef
|
||||
from _LdsOrdBase import LdsOrdBase
|
||||
from _ChildRef import ChildRef
|
||||
from _FamilyRelType import FamilyRelType
|
||||
from _MarkerType import MarkerType
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@@ -298,11 +297,7 @@ class Family(PrimaryObject,SourceBase,NoteBase,MediaBase,AttributeBase,
|
||||
between the father and mother of the relationship.
|
||||
@type relationship_type: tuple
|
||||
"""
|
||||
if type(relationship_type) == tuple:
|
||||
self.type = FamilyRelType(relationship_type)
|
||||
else:
|
||||
self.type = relationship_type
|
||||
return
|
||||
self.type.set(relationship_type)
|
||||
|
||||
def get_relationship(self):
|
||||
"""
|
||||
|
||||
@@ -234,10 +234,7 @@ class Name(BaseObject,PrivacyBase,SourceBase,NoteBase,DateBase):
|
||||
|
||||
def set_type(self,the_type):
|
||||
"""sets the type of the Name instance"""
|
||||
if type(the_type) == tuple:
|
||||
self.type = NameType(the_type)
|
||||
else:
|
||||
self.type = the_type
|
||||
self.type(the_type)
|
||||
|
||||
def get_type(self):
|
||||
"""returns the type of the Name instance"""
|
||||
|
||||
@@ -45,7 +45,6 @@ from _AddressBase import AddressBase
|
||||
from _LdsOrdBase import LdsOrdBase
|
||||
from _UrlBase import UrlBase
|
||||
from _Name import Name
|
||||
from _NameType import NameType
|
||||
from _EventRef import EventRef
|
||||
from _LdsOrd import LdsOrd
|
||||
from _PersonRef import PersonRef
|
||||
|
||||
@@ -210,10 +210,7 @@ class PrimaryObject(BaseObject,PrivacyBase):
|
||||
pass
|
||||
|
||||
def set_marker(self,marker):
|
||||
if type(marker) == tuple:
|
||||
self.marker = MarkerType(marker)
|
||||
else:
|
||||
self.marker = marker
|
||||
self.marker.set(marker)
|
||||
|
||||
def get_marker(self):
|
||||
return self.marker
|
||||
|
||||
@@ -111,7 +111,4 @@ class RepoRef(BaseObject,NoteBase,RefBase):
|
||||
return self.media_type
|
||||
|
||||
def set_media_type(self,media_type):
|
||||
if type(media_type) == tuple:
|
||||
self.media_type = SourceMediaType(media_type)
|
||||
else:
|
||||
self.media_type = media_type
|
||||
self.media_type.set(media_type)
|
||||
|
||||
@@ -140,10 +140,7 @@ class Repository(PrimaryObject,NoteBase,AddressBase,UrlBase):
|
||||
@param type: descriptive type of the Repository
|
||||
@type type: str
|
||||
"""
|
||||
if type(the_type) == tuple:
|
||||
self.type = RepositoryType(the_type)
|
||||
else:
|
||||
self.type = the_type
|
||||
self.type.set(the_type)
|
||||
|
||||
def get_type(self):
|
||||
"""
|
||||
|
||||
@@ -100,12 +100,7 @@ class Url(BaseObject,PrivacyBase):
|
||||
@param type: descriptive type of the Url
|
||||
@type type: str
|
||||
"""
|
||||
if type(the_type) == tuple:
|
||||
self.type = UrlType(the_type)
|
||||
else:
|
||||
print the_type
|
||||
assert(isinstance(the_type,UrlType))
|
||||
self.type = the_type
|
||||
self.type.set(the_type)
|
||||
|
||||
def get_type(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user