X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Fdbconn.py;h=5217462af4688754d960126e887b4203084e2766;hb=dbd3ceac44904f678181a189f34dc75c56178953;hp=41121fff1699014a6db5e3ffd1ba43bc01a83f35;hpb=603f58ac2e830affd10fef8ae98f6c3c6f499780;p=dak.git diff --git a/daklib/dbconn.py b/daklib/dbconn.py index 41121fff..5217462a 100644 --- a/daklib/dbconn.py +++ b/daklib/dbconn.py @@ -1850,6 +1850,26 @@ __all__.append('get_sections') ################################################################################ +class SignatureHistory(ORMObject): + @classmethod + def from_signed_file(cls, signed_file): + """signature history entry from signed file + + @type signed_file: L{daklib.gpg.SignedFile} + @param signed_file: signed file + + @rtype: L{SignatureHistory} + """ + self = cls() + self.fingerprint = signed_file.primary_fingerprint + self.signature_timestamp = signed_file.signature_timestamp + self.contents_sha1 = signed_file.contents_sha1() + return self + +__all__.append('SignatureHistory') + +################################################################################ + class SrcContents(ORMObject): def __init__(self, file = None, source = None): self.file = file @@ -2544,6 +2564,7 @@ class DBConn(object): 'policy_queue_byhand_file', 'priority', 'section', + 'signature_history', 'source', 'source_metadata', 'src_associations', @@ -2762,6 +2783,8 @@ class DBConn(object): properties = dict(section_id = self.tbl_section.c.id, section=self.tbl_section.c.section)) + mapper(SignatureHistory, self.tbl_signature_history) + mapper(DBSource, self.tbl_source, properties = dict(source_id = self.tbl_source.c.id, version = self.tbl_source.c.version,