* RelLib/_*.py: Make objects serialize all the way down to built-in

python objects, so that Gramps classes are never pickled.
* Date.py, CalSdn.py: Move to RelLib.
* src/dates/Date_*.py: Use new Date.
* src/plugins/*.py: Use new Date.
* src/GrampsDb/_*.py: Use new Date, new unserialize.
* src/*.py: Use new Date.


svn: r5875
This commit is contained in:
Alex Roitman
2006-02-03 22:03:53 +00:00
parent fd279d348c
commit 7329720f07
73 changed files with 1298 additions and 905 deletions

View File

@@ -1,7 +1,7 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2005 Donald N. Allingham
# Copyright (C) 2000-2006 Donald N. Allingham
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -57,6 +57,16 @@ class SourceNote(BaseObject,NoteBase):
else:
self.source_list = []
def serialize(self):
return (NoteBase.serialize(self),
[sref.serialize() for sref in self.source_list])
def unserialize(self,data):
(note,source_list) = data
NoteBase.unserialize(self,note)
self.source_list = [SourceRef().unserialize(item)
for item in source_list]
def add_source_reference(self,src_ref) :
"""
Adds a source reference to this object.