示例#1
0
    def __init__(self, data=None):
        """
        Creates a new Person instance. After initialization, most
        data items have empty or null values, including the database
        handle.
        """
        PrimaryObject.__init__(self)
        SourceBase.__init__(self)
        NoteBase.__init__(self)
        MediaBase.__init__(self)
        AttributeBase.__init__(self)
        AddressBase.__init__(self)
        UrlBase.__init__(self)
        LdsOrdBase.__init__(self)
        self.primary_name = Name()
        self.event_ref_list = []
        self.family_list = []
        self.parent_family_list = []
        self.alternate_names = []
        self.person_ref_list = []
        self.gender = Person.UNKNOWN
        self.death_ref_index = -1
        self.birth_ref_index = -1

        if data:
            self.unserialize(data)
示例#2
0
 def __init__(self):
     """creates a new Repository instance"""
     PrimaryObject.__init__(self)
     NoteBase.__init__(self)
     AddressBase.__init__(self)
     UrlBase.__init__(self)
     self.type = RepositoryType()
     self.name = ""
示例#3
0
 def __init__(self):
     """creates a new Repository instance"""
     PrimaryObject.__init__(self)
     NoteBase.__init__(self)
     AddressBase.__init__(self)
     UrlBase.__init__(self)
     self.type = RepositoryType()
     self.name = ""
示例#4
0
 def unserialize(self, data):
     """
     Converts a serialized tuple of data to an object
     """
     (source_list, note, date, self.type, self.place, self.famc, self.temple, self.status) = data
     SourceBase.unserialize(self, source_list)
     NoteBase.unserialize(self, note)
     DateBase.unserialize(self, date)
     return self
示例#5
0
 def __init__(self, source=None):
     """Creates a new Address instance, copying from the source
     if provided"""
     SecondaryObject.__init__(self)
     PrivacyBase.__init__(self, source)
     SourceBase.__init__(self, source)
     NoteBase.__init__(self, source)
     DateBase.__init__(self, source)
     LocationBase.__init__(self, source)
示例#6
0
 def unserialize(self, data):
     """
     Converts a serialized tuple of data to an object
     """
     (note, ref, self.call_number, media_type) = data
     self.media_type.unserialize(media_type)
     NoteBase.unserialize(self, note)
     RefBase.unserialize(self, ref)
     return self
示例#7
0
 def __init__(self, source=None):
     SecondaryObject.__init__(self)
     NoteBase.__init__(self, source)
     RefBase.__init__(self, source)
     if source:
         self.call_number = source.call_number
         self.media_type = source.media_type
     else:
         self.call_number = ""
         self.media_type = SourceMediaType()
示例#8
0
 def unserialize(self, data):
     """
     Converts a serialized tuple of data to an object
     """
     (source_list, note, date, self.type, self.place, self.famc,
      self.temple, self.status) = data
     SourceBase.unserialize(self, source_list)
     NoteBase.unserialize(self, note)
     DateBase.unserialize(self, date)
     return self
示例#9
0
 def unserialize(self, data):
     """
     Converts a serialized tuple of data to an object
     """
     (privacy, source_list, note, the_type, self.value) = data
     PrivacyBase.unserialize(self, privacy)
     SourceBase.unserialize(self, source_list)
     NoteBase.unserialize(self, note)
     self.type.unserialize(the_type)
     return self
示例#10
0
 def __init__(self, source=None):
     SecondaryObject.__init__(self)
     PrivacyBase.__init__(self, source)
     SourceBase.__init__(self, source)
     NoteBase.__init__(self, source)
     RefBase.__init__(self, source)
     if source:
         self.rel = source.rel
     else:
         self.rel = ''
示例#11
0
 def unserialize(self, data):
     """
     Converts a serialized tuple of data to an object
     """
     (privacy, source_list, note, ref, self.rel) = data
     PrivacyBase.unserialize(self, privacy)
     SourceBase.unserialize(self, source_list)
     NoteBase.unserialize(self, note)
     RefBase.unserialize(self, ref)
     return self
示例#12
0
 def unserialize(self, data):
     """
     Converts a serialized tuple of data to an object
     """
     (privacy, note, attribute_list, ref, role) = data
     PrivacyBase.unserialize(self, privacy)
     NoteBase.unserialize(self, note)
     AttributeBase.unserialize(self, attribute_list)
     RefBase.unserialize(self, ref)
     self.role.unserialize(role)
     return self
示例#13
0
 def unserialize(self, data):
     """
     Converts a serialized tuple of data to an object
     """
     (date, privacy, note, self.confidence, ref, self.page,
      self.text) = data
     DateBase.unserialize(self, date)
     PrivacyBase.unserialize(self, privacy)
     NoteBase.unserialize(self, note)
     RefBase.unserialize(self, ref)
     return self
示例#14
0
 def unserialize(self, data):
     """
     Converts a serialized tuple of data to an object
     """
     (date, privacy, note,
      self.confidence, ref, self.page, self.text) = data
     DateBase.unserialize(self, date)
     PrivacyBase.unserialize(self, privacy)
     NoteBase.unserialize(self, note)
     RefBase.unserialize(self, ref)
     return self
示例#15
0
 def __init__(self, source=None):
     SecondaryObject.__init__(self)
     PrivacyBase.__init__(self, source)
     SourceBase.__init__(self, source)
     NoteBase.__init__(self, source)
     RefBase.__init__(self, source)
     if source:
         self.frel = source.frel
         self.mrel = source.mrel
     else:
         self.frel = ChildRefType()
         self.mrel = ChildRefType()
示例#16
0
 def __init__(self):
     """creates a new Source instance"""
     PrimaryObject.__init__(self)
     MediaBase.__init__(self)
     NoteBase.__init__(self)
     self.title = ""
     self.author = ""
     self.pubinfo = ""
     self.note = Note()
     self.datamap = {}
     self.abbrev = ""
     self.reporef_list = []
示例#17
0
    def unserialize(self, data):
        """
        Converts the data held in a tuple created by the serialize method
        back into the data in an Repository structure.
        """
        (self.handle, self.gramps_id, the_type, self.name, note, address_list, urls, marker, self.private) = data

        self.marker.unserialize(marker)
        self.type.unserialize(the_type)
        NoteBase.unserialize(self, note)
        AddressBase.unserialize(self, address_list)
        UrlBase.unserialize(self, urls)
示例#18
0
 def __init__(self, source=None):
     SecondaryObject.__init__(self)
     PrivacyBase.__init__(self, source)
     SourceBase.__init__(self, source)
     NoteBase.__init__(self, source)
     RefBase.__init__(self, source)
     if source:
         self.frel = source.frel
         self.mrel = source.mrel
     else:
         self.frel = ChildRefType()
         self.mrel = ChildRefType()
示例#19
0
 def unserialize(self, data):
     """
     Converts a serialized tuple of data to an object
     """
     (privacy, source_list, note, date, location) = data
     
     PrivacyBase.unserialize(self, privacy)
     SourceBase.unserialize(self, source_list)
     NoteBase.unserialize(self, note)
     DateBase.unserialize(self, date)
     LocationBase.unserialize(self, location)
     return self
示例#20
0
 def __init__(self):
     """creates a new Source instance"""
     PrimaryObject.__init__(self)
     MediaBase.__init__(self)
     NoteBase.__init__(self)
     self.title = ""
     self.author = ""
     self.pubinfo = ""
     self.note = Note()
     self.datamap = {}
     self.abbrev = ""
     self.reporef_list = []
示例#21
0
    def unserialize(self, data):
        """
        Converts the data held in a tuple created by the serialize method
        back into the data in an Repository structure.
        """
        (self.handle, self.gramps_id, the_type, self.name, note,
         address_list, urls, marker, self.private) = data

        self.marker.unserialize(marker)
        self.type.unserialize(the_type)
        NoteBase.unserialize(self, note)
        AddressBase.unserialize(self, address_list)
        UrlBase.unserialize(self, urls)
示例#22
0
    def unserialize(self, data):
        """
        Converts the data held in a tuple created by the serialize method
        back into the data in an Event structure.
        """
        (self.handle, self.gramps_id, self.title, self.author, self.pubinfo,
         note, media_list, self.abbrev, self.change, self.datamap,
         reporef_list, marker, self.private) = data

        self.marker.unserialize(marker)
        NoteBase.unserialize(self, note)
        MediaBase.unserialize(self, media_list)
        self.reporef_list = [RepoRef().unserialize(rr) for rr in reporef_list]
示例#23
0
 def __init__(self, source=None):
     """
     Creates a new EventRef instance, copying from the source if present.
     """
     SecondaryObject.__init__(self)
     PrivacyBase.__init__(self, source)
     NoteBase.__init__(self, source)
     AttributeBase.__init__(self, source)
     RefBase.__init__(self, source)
     if source:
         self.role = source.role
     else:
         self.role = EventRoleType()
示例#24
0
 def unserialize(self, data):
     """
     Converts a serialized tuple of data to an object
     """
     (privacy, source_list, note, date,
      self.first_name, self.surname, self.suffix, self.title,
      name_type, self.prefix, self.patronymic,
      self.group_as, self.sort_as, self.display_as, self.call) = data
     self.type.unserialize(name_type)
     PrivacyBase.unserialize(self, privacy)
     SourceBase.unserialize(self, source_list)
     NoteBase.unserialize(self, note)
     DateBase.unserialize(self, date)
     return self
示例#25
0
    def unserialize(self, data):
        """
        Converts the data held in a tuple created by the serialize method
        back into the data in an Event structure.
        """
        (self.handle, self.gramps_id, self.title, self.author,
         self.pubinfo, note, media_list,
         self.abbrev, self.change, self.datamap, reporef_list,
         marker, self.private) = data

        self.marker.unserialize(marker)
        NoteBase.unserialize(self, note)
        MediaBase.unserialize(self, media_list)
        self.reporef_list = [RepoRef().unserialize(rr) for rr in reporef_list]
示例#26
0
 def __init__(self, source=None):
     """
     Creates a new Attribute object, copying from the source if provided.
     """
     SecondaryObject.__init__(self)
     PrivacyBase.__init__(self, source)
     SourceBase.__init__(self, source)
     NoteBase.__init__(self, source)
     
     if source:
         self.type = source.type
         self.value = source.value
     else:
         self.type = AttributeType()
         self.value = ""
示例#27
0
 def __init__(self, source=None):
     """creates a new SourceRef, copying from the source if present"""
     SecondaryObject.__init__(self)
     DateBase.__init__(self, source)
     PrivacyBase.__init__(self, source)
     NoteBase.__init__(self, source)
     RefBase.__init__(self, source)
     if source:
         self.confidence = source.confidence
         self.page = source.page
         self.text = source.text
     else:
         self.confidence = SourceRef.CONF_NORMAL
         self.page = ""
         self.text = ""
示例#28
0
 def __init__(self, source=None):
     """creates a new SourceRef, copying from the source if present"""
     SecondaryObject.__init__(self)
     DateBase.__init__(self, source)
     PrivacyBase.__init__(self, source)
     NoteBase.__init__(self, source)
     RefBase.__init__(self, source)
     if source:
         self.confidence = source.confidence
         self.page = source.page
         self.text = source.text
     else:
         self.confidence = SourceRef.CONF_NORMAL
         self.page = ""
         self.text = ""
示例#29
0
 def serialize(self):
     """
     Converts the object to a serialized tuple of data
     """
     return (PrivacyBase.serialize(self), SourceBase.serialize(self),
             NoteBase.serialize(self), RefBase.serialize(self),
             self.frel.serialize(), self.mrel.serialize())
示例#30
0
    def serialize(self):
        """
        Converts the data held in the Place to a Python tuple that
        represents all the data elements. This method is used to convert
        the object into a form that can easily be saved to a database.

        These elements may be primative Python types (string, integers),
        complex Python types (lists or tuples, or Python objects. If the
        target database cannot handle complex types (such as objectes or
        lists), the database is responsible for converting the data into
        a form that it can use.

        @returns: Returns a python tuple containing the data that should
            be considered persistent.
        @rtype: tuple
        """

        if self.main_loc == None or self.main_loc.serialize() == _EMPTY_LOC:
            main_loc = None
        else:
            main_loc = self.main_loc.serialize()

        return (self.handle, self.gramps_id, self.title, self.long, self.lat,
                main_loc, [al.serialize() for al in self.alt_loc],
                UrlBase.serialize(self),
                MediaBase.serialize(self),
                SourceBase.serialize(self),
                NoteBase.serialize(self),
                self.change, self.marker.serialize() ,self.private)
示例#31
0
 def serialize(self):
     """
     Converts the object to a serialized tuple of data
     """
     return (DateBase.serialize(self), PrivacyBase.serialize(self),
             NoteBase.serialize(self), self.confidence,
             RefBase.serialize(self), self.page, self.text)
示例#32
0
    def serialize(self):
        """
        Converts the data held in the event to a Python tuple that
        represents all the data elements. This method is used to convert
        the object into a form that can easily be saved to a database.

        These elements may be primative Python types (string, integers),
        complex Python types (lists or tuples, or Python objects. If the
        target database cannot handle complex types (such as objectes or
        lists), the database is responsible for converting the data into
        a form that it can use.

        @returns: Returns a python tuple containing the data that should
            be considered persistent.
        @rtype: tuple
        """
        return (self.handle, self.gramps_id, self.father_handle,
                self.mother_handle,
                [cr.serialize()
                 for cr in self.child_ref_list], self.type.serialize(),
                [er.serialize()
                 for er in self.event_ref_list], MediaBase.serialize(self),
                AttributeBase.serialize(self), LdsOrdBase.serialize(self),
                SourceBase.serialize(self), NoteBase.serialize(self),
                self.change, self.marker.serialize(), self.private)
示例#33
0
    def serialize(self):
        """
        Converts the data held in the event to a Python tuple that
        represents all the data elements. This method is used to convert
        the object into a form that can easily be saved to a database.

        These elements may be primative Python types (string, integers),
        complex Python types (lists or tuples, or Python objects. If the
        target database cannot handle complex types (such as objectes or
        lists), the database is responsible for converting the data into
        a form that it can use.

        @returns: Returns a python tuple containing the data that should
            be considered persistent.
        @rtype: tuple
        """
        return (self.handle, self.gramps_id, self.father_handle,
                self.mother_handle,
                [cr.serialize() for cr in self.child_ref_list],
                self.type.serialize(),
                [er.serialize() for er in self.event_ref_list],
                MediaBase.serialize(self),
                AttributeBase.serialize(self),
                LdsOrdBase.serialize(self),
                SourceBase.serialize(self),
                NoteBase.serialize(self),
                self.change, self.marker.serialize(), self.private)
示例#34
0
 def serialize(self):
     """
     Converts the object to a serialized tuple of data
     """
     return (SourceBase.serialize(self), NoteBase.serialize(self),
             DateBase.serialize(self), self.type, self.place, self.famc,
             self.temple, self.status)
示例#35
0
    def unserialize(self, data):
        """
        Converts the data held in a tuple created by the serialize method
        back into the data in a Person object.

        @param data: tuple containing the persistent data associated the
            Person object
        @type data: tuple
        """
        (self.handle,             #  0
         self.gramps_id,          #  1
         self.gender,             #  2
         primary_name,            #  3
         alternate_names,         #  4
         self.death_ref_index,    #  5
         self.birth_ref_index,    #  6
         event_ref_list,          #  7
         self.family_list,        #  8
         self.parent_family_list, #  9
         media_list,              # 10
         address_list,            # 11
         attribute_list,          # 12
         urls,                    # 13
         lds_ord_list,            # 14
         source_list,             # 15
         note,                    # 16
         self.change,             # 17
         marker,                  # 18
         self.private,            # 19
         person_ref_list,         # 20
         ) = data

        self.marker.unserialize(marker)
        self.primary_name.unserialize(primary_name)
        self.alternate_names = [Name().unserialize(name)
                                for name in alternate_names]
        self.event_ref_list = [EventRef().unserialize(er)
                               for er in event_ref_list]
        self.person_ref_list = [PersonRef().unserialize(pr)
                                for pr in person_ref_list]
        MediaBase.unserialize(self, media_list)
        LdsOrdBase.unserialize(self, lds_ord_list)
        AddressBase.unserialize(self, address_list)
        AttributeBase.unserialize(self, attribute_list)
        UrlBase.unserialize(self, urls)
        SourceBase.unserialize(self, source_list)
        NoteBase.unserialize(self, note)
示例#36
0
 def serialize(self):
     """
     Converts the object to a serialized tuple of data
     """
     return (PrivacyBase.serialize(self),
             SourceBase.serialize(self),
             NoteBase.serialize(self),
             self.type.serialize(), self.value)
示例#37
0
    def unserialize(self, data):
        """
        Converts the data held in a tuple created by the serialize method
        back into the data in an Event structure.

        @param data: tuple containing the persistent data associated the object
        @type data: tuple
        """
        (self.handle, self.gramps_id, self.path, self.mime, self.desc,
         attribute_list, source_list, note, self.change, date, marker,
         self.private) = data

        self.marker.unserialize(marker)
        AttributeBase.unserialize(self, attribute_list)
        SourceBase.unserialize(self, source_list)
        NoteBase.unserialize(self, note)
        DateBase.unserialize(self, date)
示例#38
0
    def unserialize(self, data):
        """
        Converts the data held in a tuple created by the serialize method
        back into the data in an Event structure.

        @param data: tuple containing the persistent data associated the object
        @type data: tuple
        """
        (self.handle, self.gramps_id, self.path, self.mime, self.desc,
         attribute_list, source_list, note, self.change,
         date, marker, self.private) = data

        self.marker.unserialize(marker)
        AttributeBase.unserialize(self, attribute_list)
        SourceBase.unserialize(self, source_list)
        NoteBase.unserialize(self, note)
        DateBase.unserialize(self, date)
示例#39
0
 def serialize(self):
     """
     Converts the object to a serialized tuple of data
     """
     return (
         NoteBase.serialize(self),
         RefBase.serialize(self),
         self.call_number, self.media_type.serialize())
示例#40
0
 def serialize(self):
     """
     Converts the object to a serialized tuple of data
     """
     return (PrivacyBase.serialize(self),
             SourceBase.serialize(self),
             NoteBase.serialize(self),
             DateBase.serialize(self),
             LocationBase.serialize(self))
示例#41
0
 def __init__(self):
     """
     Creates a new Family instance. After initialization, most
     data items have empty or null values, including the database
     handle.
     """
     PrimaryObject.__init__(self)
     SourceBase.__init__(self)
     NoteBase.__init__(self)
     MediaBase.__init__(self)
     AttributeBase.__init__(self)
     LdsOrdBase.__init__(self)
     self.father_handle = None
     self.mother_handle = None
     self.child_ref_list = []
     self.type = FamilyRelType()
     self.event_ref_list = []
     self.complete = 0
示例#42
0
 def __init__(self):
     """
     Creates a new Family instance. After initialization, most
     data items have empty or null values, including the database
     handle.
     """
     PrimaryObject.__init__(self)
     SourceBase.__init__(self)
     NoteBase.__init__(self)
     MediaBase.__init__(self)
     AttributeBase.__init__(self)
     LdsOrdBase.__init__(self)
     self.father_handle = None
     self.mother_handle = None
     self.child_ref_list = []
     self.type = FamilyRelType()
     self.event_ref_list = []
     self.complete = 0
示例#43
0
    def __init__(self, source=None):
        """Creates a LDS Ordinance instance"""
        SecondaryObject.__init__(self)
        SourceBase.__init__(self, source)
        NoteBase.__init__(self, source)
        DateBase.__init__(self, source)
        PlaceBase.__init__(self, source)
        PrivacyBase.__init__(self, source)

        if source:
            self.type = source.type
            self.famc = source.famc
            self.temple = source.temple
            self.status = source.status
        else:
            self.type = LdsOrd.DEFAULT_TYPE
            self.famc = None
            self.temple = ""
            self.status = LdsOrd.DEFAULT_STATUS
示例#44
0
 def serialize(self):
     """
     Converts the object to a serialized tuple of data
     """
     return (PrivacyBase.serialize(self),
             SourceBase.serialize(self),
             NoteBase.serialize(self),
             AttributeBase.serialize(self),
             RefBase.serialize(self),
             self.rect)
示例#45
0
 def serialize(self):
     """
     Converts the object to a serialized tuple of data
     """
     return (PrivacyBase.serialize(self),
             SourceBase.serialize(self),
             NoteBase.serialize(self),
             RefBase.serialize(self),
             self.frel.serialize(),
             self.mrel.serialize())