コード例 #1
0
ファイル: mediaobj.py プロジェクト: arpalmares/portableApps
    def __init__(self, source=None):
        """
        Initialize a MediaObject. 
        
        If source is not None, then object is initialized from values of the 
        source object.

        :param source: Object used to initialize the new object
        :type source: MediaObject
        """
        PrimaryObject.__init__(self, source)
        CitationBase.__init__(self, source)
        NoteBase.__init__(self, source)
        DateBase.__init__(self, source)
        AttributeBase.__init__(self, source)
        TagBase.__init__(self)

        if source:
            self.path = source.path
            self.mime = source.mime
            self.desc = source.desc
            self.thumb = source.thumb
        else:
            self.path = ""
            self.mime = ""
            self.desc = ""
            self.thumb = None
コード例 #2
0
ファイル: family.py プロジェクト: arpalmares/portableApps
    def unserialize(self, data):
        """
        Convert the data held in a tuple created by the serialize method
        back into the data in a Family structure.
        """
        (self.handle, self.gramps_id, self.father_handle, self.mother_handle,
         child_ref_list, the_type, event_ref_list, media_list, attribute_list,
         lds_seal_list, citation_list, note_list, self.change, tag_list,
         self.private) = data

        self.type = FamilyRelType()
        self.type.unserialize(the_type)
        self.event_ref_list = [
            EventRef().unserialize(er) for er in event_ref_list
        ]
        self.child_ref_list = [
            ChildRef().unserialize(cr) for cr in child_ref_list
        ]
        MediaBase.unserialize(self, media_list)
        AttributeBase.unserialize(self, attribute_list)
        CitationBase.unserialize(self, citation_list)
        NoteBase.unserialize(self, note_list)
        LdsOrdBase.unserialize(self, lds_seal_list)
        TagBase.unserialize(self, tag_list)
        return self
コード例 #3
0
ファイル: address.py プロジェクト: PyCManager/portableApps
 def __init__(self, source=None):
     """
     Create a new Address instance, copying from the source if provided.
     """
     PrivacyBase.__init__(self, source)
     CitationBase.__init__(self, source)
     NoteBase.__init__(self, source)
     DateBase.__init__(self, source)
     LocationBase.__init__(self, source)
コード例 #4
0
 def __init__(self, source=None):
     PrivacyBase.__init__(self, source)
     CitationBase.__init__(self, source)
     NoteBase.__init__(self, source)
     RefBase.__init__(self, source)
     if source:
         self.rel = source.rel
     else:
         self.rel = ''
コード例 #5
0
ファイル: reporef.py プロジェクト: arpalmares/portableApps
 def __init__(self, source=None):
     PrivacyBase.__init__(self, source)
     NoteBase.__init__(self, source)
     RefBase.__init__(self, source)
     if source:
         self.call_number = source.call_number
         self.media_type = SourceMediaType(source.media_type)
     else:
         self.call_number = ""
         self.media_type = SourceMediaType()
コード例 #6
0
 def unserialize(self, data):
     """
     Convert a serialized tuple of data to an object.
     """
     (privacy, citation_list, note_list, the_type, self.value) = data
     PrivacyBase.unserialize(self, privacy)
     CitationBase.unserialize(self, citation_list)
     NoteBase.unserialize(self, note_list)
     self.type.unserialize(the_type)
     return self
コード例 #7
0
ファイル: repo.py プロジェクト: arpalmares/portableApps
 def __init__(self):
     """
     Create a new Repository instance.
     """
     PrimaryObject.__init__(self)
     NoteBase.__init__(self)
     AddressBase.__init__(self)
     UrlBase.__init__(self)
     self.type = RepositoryType()
     self.name = ""
コード例 #8
0
 def unserialize(self, data):
     """
     Convert a serialized tuple of data to an object.
     """
     (privacy, citation_list, note_list, ref, self.rel) = data
     PrivacyBase.unserialize(self, privacy)
     CitationBase.unserialize(self, citation_list)
     NoteBase.unserialize(self, note_list)
     RefBase.unserialize(self, ref)
     return self
コード例 #9
0
 def __init__(self):
     """Create a new Citation instance."""
     PrimaryObject.__init__(self)
     MediaBase.__init__(self)  #  7
     NoteBase.__init__(self)  #  6
     DateBase.__init__(self)  #  2
     self.source_handle = None  #  5
     self.page = ""  #  3
     self.confidence = Citation.CONF_NORMAL  #  4
     self.datamap = {}  #  8
コード例 #10
0
ファイル: ldsord.py プロジェクト: arpalmares/portableApps
 def unserialize(self, data):
     """
     Convert a serialized tuple of data to an object.
     """
     (citation_list, note_list, date, self.type, self.place,
      self.famc, self.temple, self.status, self.private) = data
     CitationBase.unserialize(self, citation_list)
     NoteBase.unserialize(self, note_list)
     DateBase.unserialize(self, date)
     return self
コード例 #11
0
 def __init__(self, source=None):
     PrivacyBase.__init__(self, source)
     CitationBase.__init__(self, source)
     NoteBase.__init__(self, source)
     RefBase.__init__(self, source)
     if source:
         self.frel = ChildRefType(source.frel)
         self.mrel = ChildRefType(source.mrel)
     else:
         self.frel = ChildRefType()
         self.mrel = ChildRefType()
コード例 #12
0
ファイル: mediaref.py プロジェクト: arpalmares/portableApps
    def __init__(self, source=None):
        PrivacyBase.__init__(self, source)
        CitationBase.__init__(self, source)
        NoteBase.__init__(self, source)
        RefBase.__init__(self, source)
        AttributeBase.__init__(self, source)

        if source:
            self.rect = source.rect
        else:
            self.rect = None
コード例 #13
0
ファイル: src.py プロジェクト: arpalmares/portableApps
 def __init__(self):
     """Create a new Source instance."""
     PrimaryObject.__init__(self)
     MediaBase.__init__(self)
     NoteBase.__init__(self)
     self.title = ""
     self.author = ""
     self.pubinfo = ""
     self.datamap = {}
     self.abbrev = ""
     self.reporef_list = []
コード例 #14
0
ファイル: reporef.py プロジェクト: arpalmares/portableApps
 def unserialize(self, data):
     """
     Convert a serialized tuple of data to an object.
     """
     (note_list, ref, self.call_number, media_type, privacy) = data
     self.media_type = SourceMediaType()
     self.media_type.unserialize(media_type)
     PrivacyBase.unserialize(self, privacy)
     NoteBase.unserialize(self, note_list)
     RefBase.unserialize(self, ref)
     return self
コード例 #15
0
ファイル: address.py プロジェクト: PyCManager/portableApps
    def unserialize(self, data):
        """
        Convert a serialized tuple of data to an object.
        """
        (privacy, citation_list, note_list, date, location) = data

        PrivacyBase.unserialize(self, privacy)
        CitationBase.unserialize(self, citation_list)
        NoteBase.unserialize(self, note_list)
        DateBase.unserialize(self, date)
        LocationBase.unserialize(self, location)
        return self
コード例 #16
0
 def __init__(self, source=None):
     """
     Create a new EventRef instance, copying from the source if present.
     """
     PrivacyBase.__init__(self, source)
     NoteBase.__init__(self, source)
     AttributeBase.__init__(self, source)
     RefBase.__init__(self, source)
     if source:
         self.__role = EventRoleType(source.__role)
     else:
         self.__role = EventRoleType()
コード例 #17
0
 def unserialize(self, data):
     """
     Convert a serialized tuple of data to an object.
     """
     (privacy, note_list, attribute_list, ref, role) = data
     PrivacyBase.unserialize(self, privacy)
     NoteBase.unserialize(self, note_list)
     AttributeBase.unserialize(self, attribute_list)
     RefBase.unserialize(self, ref)
     self.__role = EventRoleType()
     self.__role.unserialize(role)
     return self
コード例 #18
0
 def unserialize(self, data):
     """
     Convert a serialized tuple of data to an object.
     """
     (privacy, citation_list, note_list, ref, frel, mrel) = data
     PrivacyBase.unserialize(self, privacy)
     CitationBase.unserialize(self, citation_list)
     NoteBase.unserialize(self, note_list)
     RefBase.unserialize(self, ref)
     self.frel = ChildRefType()
     self.frel.unserialize(frel)
     self.mrel = ChildRefType()
     self.mrel.unserialize(mrel)
     return self
コード例 #19
0
 def __init__(self, source=None):
     """
     Create a new Attribute object, copying from the source if provided.
     """
     PrivacyBase.__init__(self, source)
     CitationBase.__init__(self, source)
     NoteBase.__init__(self, source)
     
     if source:
         self.type = AttributeType(source.type)
         self.value = source.value
     else:
         self.type = AttributeType()
         self.value = ""
コード例 #20
0
ファイル: repo.py プロジェクト: arpalmares/portableApps
    def unserialize(self, data):
        """
        Convert the data held in a tuple created by the serialize method
        back into the data in a Repository structure.
        """
        (self.handle, self.gramps_id, the_type, self.name, note_list,
         address_list, urls, self.change, self.private) = data

        self.type = RepositoryType()
        self.type.unserialize(the_type)
        NoteBase.unserialize(self, note_list)
        AddressBase.unserialize(self, address_list)
        UrlBase.unserialize(self, urls)
        return self
コード例 #21
0
ファイル: src.py プロジェクト: arpalmares/portableApps
    def unserialize(self, data):
        """
        Convert 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_list, media_list, self.abbrev, self.change, self.datamap,
         reporef_list, self.private) = data

        NoteBase.unserialize(self, note_list)
        MediaBase.unserialize(self, media_list)
        self.reporef_list = [
            RepoRef().unserialize(item) for item in reporef_list
        ]
        return self
コード例 #22
0
 def unserialize(self, data):
     """
     Convert a serialized tuple of data to an object.
     """
     (privacy, citation_list, note_list, date, self.first_name,
      surname_list, self.suffix, self.title, name_type, self.group_as,
      self.sort_as, self.display_as, self.call, self.nick,
      self.famnick) = data
     self.type = NameType(name_type)
     PrivacyBase.unserialize(self, privacy)
     SurnameBase.unserialize(self, surname_list)
     CitationBase.unserialize(self, citation_list)
     NoteBase.unserialize(self, note_list)
     DateBase.unserialize(self, date)
     return self
コード例 #23
0
ファイル: family.py プロジェクト: arpalmares/portableApps
    def serialize(self):
        """
        Convert 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 primitive Python types (string, integers),
        complex Python types (lists or tuples, or Python objects. If the
        target database cannot handle complex types (such as objects 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),
                CitationBase.serialize(self), NoteBase.serialize(self),
                self.change, TagBase.serialize(self), self.private)
コード例 #24
0
ファイル: address.py プロジェクト: PyCManager/portableApps
 def serialize(self):
     """
     Convert the object to a serialized tuple of data.
     """
     return (PrivacyBase.serialize(self), CitationBase.serialize(self),
             NoteBase.serialize(self), DateBase.serialize(self),
             LocationBase.serialize(self))
コード例 #25
0
ファイル: place.py プロジェクト: arpalmares/portableApps
    def serialize(self):
        """
        Convert 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 primitive Python types (string, integers),
        complex Python types (lists or tuples, or Python objects. If the
        target database cannot handle complex types (such as objects 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 is 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), CitationBase.serialize(self),
                NoteBase.serialize(self), self.change, self.private)
コード例 #26
0
 def serialize(self):
     """
     Convert the object to a serialized tuple of data.
     """
     return (PrivacyBase.serialize(self), CitationBase.serialize(self),
             NoteBase.serialize(self), RefBase.serialize(self),
             self.frel.serialize(), self.mrel.serialize())
コード例 #27
0
 def serialize(self):
     """
     Convert the object to a serialized tuple of data.
     """
     return (PrivacyBase.serialize(self), NoteBase.serialize(self),
             AttributeBase.serialize(self), RefBase.serialize(self),
             self.__role.serialize())
コード例 #28
0
 def serialize(self):
     """
     Convert the object to a serialized tuple of data.
     """
     return (PrivacyBase.serialize(self),
             CitationBase.serialize(self),
             NoteBase.serialize(self),
             self.type.serialize(), self.value)
コード例 #29
0
ファイル: mediaobj.py プロジェクト: arpalmares/portableApps
    def unserialize(self, data):
        """
        Convert 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, citation_list, note_list, self.change, date, tag_list,
         self.private) = data

        AttributeBase.unserialize(self, attribute_list)
        CitationBase.unserialize(self, citation_list)
        NoteBase.unserialize(self, note_list)
        DateBase.unserialize(self, date)
        TagBase.unserialize(self, tag_list)
コード例 #30
0
ファイル: repo.py プロジェクト: arpalmares/portableApps
 def serialize(self):
     """
     Convert the object to a serialized tuple of data.
     """
     return (self.handle, self.gramps_id, self.type.serialize(),
             unicode(self.name), NoteBase.serialize(self),
             AddressBase.serialize(self), UrlBase.serialize(self),
             self.change, self.private)