* 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:
Alex Roitman
2006-04-21 00:03:27 +00:00
parent e2ee414615
commit dce92d31a3
12 changed files with 46 additions and 116 deletions

View File

@@ -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):
"""

View File

@@ -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)

View File

@@ -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):
"""

View File

@@ -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"""

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -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):
"""

View File

@@ -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):
"""