################################################################################
-def parse_deb822(armored_contents, signing_rules=0, keyrings=None):
+@session_wrapper
+def parse_deb822(armored_contents, signing_rules=0, keyrings=None, session=None):
if keyrings == None:
- keyrings = [ k.keyring_name for k in DBConn().session().query(Keyring).filter(Keyring.active == True).all() ]
+ keyrings = [ k.keyring_name for k in session.query(Keyring).filter(Keyring.active == True).all() ]
require_signature = True
if signing_rules == -1:
require_signature = False
################################################################################
-def parse_changes(filename, signing_rules=0, dsc_file=0, keyrings=None):
+@session_wrapper
+def parse_changes(filename, signing_rules=0, dsc_file=0, keyrings=None, session=None):
"""
Parses a changes file and returns a dictionary where each field is a
key. The mandatory first argument is the filename of the .changes
unicode(content, 'utf-8')
except UnicodeError:
raise ChangesUnicodeError, "Changes file not proper utf-8"
- changes = parse_deb822(content, signing_rules, keyrings=keyrings)
+ changes = parse_deb822(content, signing_rules, keyrings=keyrings, session=session)
if not dsc_file: