2006-08-17 Alex Roitman <shura@gramps-project.org>
* src/NameDisplay.py: Correct constants to accomodate Name change. * src/GrampsDb/_GrampsBSDDB.py: Upgrade the names. * src/RelLib/_Name.py: Remove sname attribute. svn: r7200
This commit is contained in:
parent
5ee9a2ed9b
commit
706f8887a5
@ -1,3 +1,8 @@
|
|||||||
|
2006-08-17 Alex Roitman <shura@gramps-project.org>
|
||||||
|
* src/NameDisplay.py: Correct constants to accomodate Name change.
|
||||||
|
* src/GrampsDb/_GrampsBSDDB.py: Upgrade the names.
|
||||||
|
* src/RelLib/_Name.py: Remove sname attribute.
|
||||||
|
|
||||||
2006-08-17 Don Allingham <don@gramps-project.org>
|
2006-08-17 Don Allingham <don@gramps-project.org>
|
||||||
* src/DataViews/_PersonView.py: apply filter to calcuated data before
|
* src/DataViews/_PersonView.py: apply filter to calcuated data before
|
||||||
deleting a person from the list
|
deleting a person from the list
|
||||||
|
@ -1765,9 +1765,6 @@ class GrampsBSDDB(GrampsDbBase,UpdateCallback):
|
|||||||
event.source_list, event.note, witness_list,
|
event.source_list, event.note, witness_list,
|
||||||
event.media_list, event.change) = info
|
event.media_list, event.change) = info
|
||||||
|
|
||||||
if event.source_list != []:
|
|
||||||
print [sr.serialize() for sr in event.source_list]
|
|
||||||
|
|
||||||
# Change ID if it is non-unique
|
# Change ID if it is non-unique
|
||||||
if event.gramps_id in dup_ids:
|
if event.gramps_id in dup_ids:
|
||||||
max_id_number += 1
|
max_id_number += 1
|
||||||
@ -1936,7 +1933,7 @@ class GrampsBSDDB(GrampsDbBase,UpdateCallback):
|
|||||||
urls,lds_ord_list,source_list,note,change,marker,
|
urls,lds_ord_list,source_list,note,change,marker,
|
||||||
private,person_ref_list,) = info
|
private,person_ref_list,) = info
|
||||||
|
|
||||||
new_info = (handle,gramps_id,gender,primary_name,alternate_names,
|
new_info = (handle,gramps_id,gender,Name().serialize(),[],
|
||||||
death_ref_index,birth_ref_index,[],
|
death_ref_index,birth_ref_index,[],
|
||||||
family_list,parent_family_list,media_list,address_list,
|
family_list,parent_family_list,media_list,address_list,
|
||||||
attribute_list,urls,lds_ord_list,source_list,note,
|
attribute_list,urls,lds_ord_list,source_list,note,
|
||||||
@ -1944,7 +1941,13 @@ class GrampsBSDDB(GrampsDbBase,UpdateCallback):
|
|||||||
|
|
||||||
person = Person()
|
person = Person()
|
||||||
person.unserialize(new_info)
|
person.unserialize(new_info)
|
||||||
|
|
||||||
|
# Names lost the "sname" attribute
|
||||||
|
person.primary_name.unserialize(convert_name_10(primary_name))
|
||||||
|
person.alternate_names = [Name().unserialize(convert_name_10(name))
|
||||||
|
for name in alternate_names]
|
||||||
|
|
||||||
|
# Events gained attribute_list
|
||||||
for (privacy,note,ref,role) in event_ref_list:
|
for (privacy,note,ref,role) in event_ref_list:
|
||||||
event_ref = EventRef()
|
event_ref = EventRef()
|
||||||
new_event_ref_data = (privacy,note,[],ref,role)
|
new_event_ref_data = (privacy,note,[],ref,role)
|
||||||
@ -2147,6 +2150,12 @@ def _table_low_level_9(env,table):
|
|||||||
the_txn.commit()
|
the_txn.commit()
|
||||||
return (True,length)
|
return (True,length)
|
||||||
|
|
||||||
|
def convert_name_10(name):
|
||||||
|
# Names lost the "sname" attribute
|
||||||
|
(privacy,source_list,note,date,first_name,surname,suffix,title,name_type,
|
||||||
|
prefix,patronymic,sname,group_as,sort_as,display_as,call) = name
|
||||||
|
return (privacy,source_list,note,date,first_name,surname,suffix,title,
|
||||||
|
name_type,prefix,patronymic,group_as,sort_as,display_as,call)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
|
@ -51,11 +51,10 @@ _TITLE = 7
|
|||||||
_TYPE = 8
|
_TYPE = 8
|
||||||
_PREFIX = 9
|
_PREFIX = 9
|
||||||
_PATRONYM = 10
|
_PATRONYM = 10
|
||||||
_SNAME = 11
|
_GROUP = 11
|
||||||
_GROUP = 12
|
_SORT = 12
|
||||||
_SORT = 13
|
_DISPLAY = 13
|
||||||
_DISPLAY = 14
|
_CALL = 14
|
||||||
_CALL = 15
|
|
||||||
|
|
||||||
_ACT = True
|
_ACT = True
|
||||||
_INA = False
|
_INA = False
|
||||||
|
@ -67,7 +67,7 @@ class Name(SecondaryObject,PrivacyBase,SourceBase,NoteBase,DateBase):
|
|||||||
if data:
|
if data:
|
||||||
(privacy,source_list,note,date,
|
(privacy,source_list,note,date,
|
||||||
self.first_name,self.surname,self.suffix,self.title,
|
self.first_name,self.surname,self.suffix,self.title,
|
||||||
name_type,self.prefix,self.patronymic,self.sname,
|
name_type,self.prefix,self.patronymic,
|
||||||
self.group_as,self.sort_as,self.display_as,self.call) = data
|
self.group_as,self.sort_as,self.display_as,self.call) = data
|
||||||
self.type = NameType(name_type)
|
self.type = NameType(name_type)
|
||||||
PrivacyBase.unserialize(self,privacy)
|
PrivacyBase.unserialize(self,privacy)
|
||||||
@ -86,7 +86,6 @@ class Name(SecondaryObject,PrivacyBase,SourceBase,NoteBase,DateBase):
|
|||||||
self.type = source.type
|
self.type = source.type
|
||||||
self.prefix = source.prefix
|
self.prefix = source.prefix
|
||||||
self.patronymic = source.patronymic
|
self.patronymic = source.patronymic
|
||||||
self.sname = source.sname
|
|
||||||
self.group_as = source.group_as
|
self.group_as = source.group_as
|
||||||
self.sort_as = source.sort_as
|
self.sort_as = source.sort_as
|
||||||
self.display_as = source.display_as
|
self.display_as = source.display_as
|
||||||
@ -103,7 +102,6 @@ class Name(SecondaryObject,PrivacyBase,SourceBase,NoteBase,DateBase):
|
|||||||
self.type = NameType()
|
self.type = NameType()
|
||||||
self.prefix = ""
|
self.prefix = ""
|
||||||
self.patronymic = ""
|
self.patronymic = ""
|
||||||
self.sname = '@'
|
|
||||||
self.group_as = ""
|
self.group_as = ""
|
||||||
self.sort_as = self.DEF
|
self.sort_as = self.DEF
|
||||||
self.display_as = self.DEF
|
self.display_as = self.DEF
|
||||||
@ -115,13 +113,13 @@ class Name(SecondaryObject,PrivacyBase,SourceBase,NoteBase,DateBase):
|
|||||||
NoteBase.serialize(self),
|
NoteBase.serialize(self),
|
||||||
DateBase.serialize(self),
|
DateBase.serialize(self),
|
||||||
self.first_name,self.surname,self.suffix,self.title,
|
self.first_name,self.surname,self.suffix,self.title,
|
||||||
self.type.serialize(),self.prefix,self.patronymic,self.sname,
|
self.type.serialize(),self.prefix,self.patronymic,
|
||||||
self.group_as,self.sort_as,self.display_as,self.call)
|
self.group_as,self.sort_as,self.display_as,self.call)
|
||||||
|
|
||||||
def unserialize(self,data):
|
def unserialize(self,data):
|
||||||
(privacy,source_list,note,date,
|
(privacy,source_list,note,date,
|
||||||
self.first_name,self.surname,self.suffix,self.title,
|
self.first_name,self.surname,self.suffix,self.title,
|
||||||
name_type,self.prefix,self.patronymic,self.sname,
|
name_type,self.prefix,self.patronymic,
|
||||||
self.group_as,self.sort_as,self.display_as,self.call) = data
|
self.group_as,self.sort_as,self.display_as,self.call) = data
|
||||||
self.type.unserialize(name_type)
|
self.type.unserialize(name_type)
|
||||||
PrivacyBase.unserialize(self,privacy)
|
PrivacyBase.unserialize(self,privacy)
|
||||||
|
Loading…
Reference in New Issue
Block a user