2006-04-20 Alex Roitman <shura@gramps-project.org>

* src/RelLib/_EventRef.py (unserialize): Avoid class constructor.
	* src/RelLib/_Person.py (unserialize): Avoid class constructor.
	* src/RelLib/_Name.py (unserialize): Avoid class constructor.
	* src/RelLib/_Repository.py (unserialize): Avoid class constructor.
	* src/RelLib/_RepoRef.py (unserialize): Avoid class constructor.
	* src/GrampsDb/_WriteXML.py: Update to export new types.



svn: r6382
This commit is contained in:
Alex Roitman 2006-04-20 18:20:55 +00:00
parent b3c5c9816a
commit 232e32b2c1
7 changed files with 18 additions and 13 deletions

View File

@ -1,3 +1,11 @@
2006-04-20 Alex Roitman <shura@gramps-project.org>
* src/RelLib/_EventRef.py (unserialize): Avoid class constructor.
* src/RelLib/_Person.py (unserialize): Avoid class constructor.
* src/RelLib/_Name.py (unserialize): Avoid class constructor.
* src/RelLib/_Repository.py (unserialize): Avoid class constructor.
* src/RelLib/_RepoRef.py (unserialize): Avoid class constructor.
* src/GrampsDb/_WriteXML.py: Update to export new types.
2006-04-19 Alex Roitman <shura@gramps-project.org>
* src/Editors/_EditPrimary.py (EditPrimary.build_window_key):
Always have a window key, even if there is no handle.

View File

@ -549,7 +549,7 @@ class XmlWriter:
return
sp = " "*index
priv_text = conf_priv(eventref)
role = _ConstXML.str_for_xml(_ConstXML.event_roles,eventref.role)
role = eventref.role.xml_str()
if role:
role_text = ' role="%s"' % role
else:
@ -571,7 +571,7 @@ class XmlWriter:
self.write_primary_tag("event",event,2)
sp = " " * index
etype = _ConstXML.str_for_xml(_ConstXML.events,event.get_type())
etype = event.get_type().xml_str()
self.g.write(' %s<type>%s</type>\n' % (sp,self.fix(etype)) )
self.write_date(event.get_date_object(),index+1)
self.write_ref("place",event.get_place_handle(),index+1)
@ -645,8 +645,7 @@ class XmlWriter:
if not obj:
return
sp = " "*index
marker = _ConstXML.str_for_xml(_ConstXML.marker_types,
obj.get_marker())
marker = obj.get_marker().xml_str()
if marker:
marker_text = ' marker="%s"' % marker
else:
@ -663,8 +662,7 @@ class XmlWriter:
sp = " "*index
self.write_primary_tag('family',family,index)
if family:
rel = _ConstXML.str_for_xml(_ConstXML.family_relations,
family.get_relationship())
rel = family.get_relationship().xml_str()
if rel != "":
self.g.write(' %s<rel type="%s"/>\n' % (sp,rel) )
@ -902,8 +900,7 @@ class XmlWriter:
else:
callno_text = ' callno="%s"' % reporef.call_number
mtype = _ConstXML.str_for_xml(_ConstXML.source_media_types,
reporef.media_type)
mtype = reporef.media_type.xml_str()
if mtype:
type_text = ' medium="%s"' % mtype
else:

View File

@ -81,7 +81,7 @@ class EventRef(BaseObject,PrivacyBase,NoteBase,RefBase):
PrivacyBase.unserialize(self,privacy)
NoteBase.unserialize(self,note)
RefBase.unserialize(self,ref)
self.role = EventRoleType(role)
self.role.unserialize(role)
return self
def get_text_data_list(self):

View File

@ -121,7 +121,7 @@ class Name(BaseObject,PrivacyBase,SourceBase,NoteBase,DateBase):
self.first_name,self.surname,self.suffix,self.title,
name_type,self.prefix,self.patronymic,self.sname,
self.group_as,self.sort_as,self.display_as) = data
self.type = NameType(name_type)
self.type.unserialize(name_type)
PrivacyBase.unserialize(self,privacy)
SourceBase.unserialize(self,source_list)
NoteBase.unserialize(self,note)

View File

@ -201,7 +201,7 @@ class Person(PrimaryObject,SourceBase,NoteBase,MediaBase,
person_ref_list, # 21
) = data
self.marker = MarkerType(marker)
self.marker.unserialize(marker)
self.primary_name.unserialize(primary_name)
if death_ref:
self.death_ref = EventRef().unserialize(death_ref)

View File

@ -63,7 +63,7 @@ class RepoRef(BaseObject,NoteBase,RefBase):
def unserialize(self,data):
(note,ref,self.call_number,media_type) = data
self.media_type = SourceMediaType(media_type)
self.media_type.unserialize(media_type)
NoteBase.unserialize(self,note)
RefBase.unserialize(self,ref)
return self

View File

@ -75,7 +75,7 @@ class Repository(PrimaryObject,NoteBase,AddressBase,UrlBase):
(self.handle, self.gramps_id, the_type, self.name, note,
address_list, urls ,self.marker, self.private) = data
self.type = RepositoryType(the_type)
self.type.unserialize(the_type)
NoteBase.unserialize(self,note)
AddressBase.unserialize(self,address_list)
UrlBase.unserialize(self,urls)