Trees | Indices | Help |
|
---|
|
1 # 2 # Gramps - a GTK+/GNOME based genealogy program 3 # 4 # Copyright (C) 2000-2007 Donald N. Allingham 5 # 6 # This program is free software; you can redistribute it and/or modify 7 # it under the terms of the GNU General Public License as published by 8 # the Free Software Foundation; either version 2 of the License, or 9 # (at your option) any later version. 10 # 11 # This program is distributed in the hope that it will be useful, 12 # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 # GNU General Public License for more details. 15 # 16 # You should have received a copy of the GNU General Public License 17 # along with this program; if not, write to the Free Software 18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 # 20 21 # $Id: mediaref.py 10103 2008-02-24 13:55:55Z acraphae $ 22 23 """ 24 Media Reference class for GRAMPS. 25 """ 26 27 #------------------------------------------------------------------------- 28 # 29 # GRAMPS modules 30 # 31 #------------------------------------------------------------------------- 32 from gen.lib.secondaryobj import SecondaryObject 33 from gen.lib.privacybase import PrivacyBase 34 from gen.lib.srcbase import SourceBase 35 from gen.lib.notebase import NoteBase 36 from gen.lib.refbase import RefBase 37 from gen.lib.attrbase import AttributeBase 38 39 #------------------------------------------------------------------------- 40 # 41 # MediaObject References for Person/Place/Source 42 # 43 #-------------------------------------------------------------------------46 """Media reference class."""14148 PrivacyBase.__init__(self, source) 49 SourceBase.__init__(self, source) 50 NoteBase.__init__(self, source) 51 RefBase.__init__(self, source) 52 AttributeBase.__init__(self, source) 53 54 if source: 55 self.rect = source.rect 56 else: 57 self.rect = None5860 """ 61 Convert the object to a serialized tuple of data. 62 """ 63 return (PrivacyBase.serialize(self), 64 SourceBase.serialize(self), 65 NoteBase.serialize(self), 66 AttributeBase.serialize(self), 67 RefBase.serialize(self), 68 self.rect)6971 """ 72 Convert a serialized tuple of data to an object. 73 """ 74 (privacy, source_list, note_list,attribute_list,ref,self.rect) = data 75 PrivacyBase.unserialize(self, privacy) 76 SourceBase.unserialize(self, source_list) 77 NoteBase.unserialize(self, note_list) 78 AttributeBase.unserialize(self, attribute_list) 79 RefBase.unserialize(self, ref) 80 return self8183 """ 84 Return the list of child objects that may carry textual data. 85 86 @return: Returns the list of child objects that may carry textual data. 87 @rtype: list 88 """ 89 return self.attribute_list + self.source_list9092 """ 93 Return the list of child secondary objects that may refer sources. 94 95 @return: Returns the list of child secondary child objects that may 96 refer sources. 97 @rtype: list 98 """ 99 return self.attribute_list100102 """ 103 Return the list of child secondary objects that may refer notes. 104 105 @return: Returns the list of child secondary child objects that may 106 refer notes. 107 @rtype: list 108 """ 109 return self.attribute_list + self.source_list110112 """ 113 Return the list of (classname, handle) tuples for all directly 114 referenced primary objects. 115 116 @return: List of (classname, handle) tuples for referenced objects. 117 @rtype: list 118 """ 119 ret = self.get_referenced_note_handles() 120 if self.ref: 121 ret += [('MediaObject', self.ref)] 122 return ret123125 """ 126 Return the list of child objects which may, directly or through 127 their children, reference primary objects. 128 129 @return: Returns the list of objects refereincing primary objects. 130 @rtype: list 131 """ 132 return self.attribute_list + self.source_list133 137
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sun Mar 9 21:53:08 2008 | http://epydoc.sourceforge.net |