diff options
Diffstat (limited to 'portage_processor.py')
-rw-r--r-- | portage_processor.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/portage_processor.py b/portage_processor.py index 2403cdf..66fb970 100644 --- a/portage_processor.py +++ b/portage_processor.py @@ -1,4 +1,4 @@ -import re, StringIO +import os, re, StringIO, time class PortageProcessor: _r = { @@ -10,11 +10,11 @@ class PortageProcessor: 'escapes' : re.compile(r"\x1b\[[^\x40-\x7e]*[\x40-\x7e]") } - def __init__(self, db, storage): - self.db = db + def __init__(self, storage): self.storage = storage - def process(self, request, source): + def process(self, request, source, db): + group_id = db.insert_group(request.group_name, 'portage', int(time.time())) for f in request.files: matches = 0 pkg_failed = False @@ -72,3 +72,4 @@ class PortageProcessor: ''') self.storage.save_file(source, f.filename, output.getvalue()) + file_id = db.insert_file(os.path.join(source, f.filename), group_id) |