X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Fcommand.py;h=c1f9c706e02a443145c2065f5cc66850d9e5952b;hb=f3348848da60163e2aeaaa94454147764f5edd1d;hp=3fe47703765a0c8c13e87027172432a390cfdd4e;hpb=8edf5e1387ee12c35076a8c60f61e71cd6cb8e23;p=dak.git diff --git a/daklib/command.py b/daklib/command.py index 3fe47703..c1f9c706 100644 --- a/daklib/command.py +++ b/daklib/command.py @@ -35,15 +35,15 @@ class CommandError(Exception): pass class CommandFile(object): - def __init__(self, path, log=None): + def __init__(self, filename, data, log=None): if log is None: from daklib.daklog import Logger log = Logger() self.cc = [] self.result = [] self.log = log - self.path = path - self.filename = os.path.basename(path) + self.filename = filename + self.data = data def _check_replay(self, signed_file, session): """check for replays @@ -130,8 +130,7 @@ class CommandFile(object): keyrings = session.query(Keyring).filter_by(active=True).order_by(Keyring.priority) keyring_files = [ k.keyring_name for k in keyrings ] - raw_contents = open(self.path, 'r').read() - signed_file = SignedFile(raw_contents, keyring_files) + signed_file = SignedFile(self.data, keyring_files) if not signed_file.valid: self.log.log(['invalid signature', self.filename]) return False