]> git.decadent.org.uk Git - dak.git/blobdiff - dak/show_new.py
Merge remote-tracking branch 'mithrandir/master' into merge
[dak.git] / dak / show_new.py
index 488005636e09c9ef17f597091b1ae440a620db1b..1397a324f6eae35d2fd8a5b5d105fda3a1a6bdb9 100755 (executable)
@@ -223,7 +223,8 @@ def init(session):
     cnf = Config()
 
     Arguments = [('h',"help","Show-New::Options::Help"),
-                 ("p","html-path","Show-New::HTMLPath","HasArg")]
+                 ("p","html-path","Show-New::HTMLPath","HasArg"),
+                 ('q','queue','Show-New::Options::Queue','HasArg')]
 
     for i in ["help"]:
         if not cnf.has_key("Show-New::Options::%s" % (i)):
@@ -235,8 +236,9 @@ def init(session):
     if Options["help"]:
         usage()
 
+    queue_names = Options.find('Queue', 'new').split(',')
     uploads = session.query(PolicyQueueUpload) \
-        .join(PolicyQueueUpload.policy_queue).filter(PolicyQueue.queue_name == 'new') \
+        .join(PolicyQueueUpload.policy_queue).filter(PolicyQueue.queue_name.in_(queue_names)) \
         .join(PolicyQueueUpload.changes).order_by(DBChange.source)
 
     if len(changesnames) > 0:
@@ -256,10 +258,12 @@ def main():
     upload_ids = [ u.id for u in init(session) ]
     session.close()
 
-    p = pool.map_async(do_pkg, upload_ids)
+    for upload_id in upload_ids:
+        pool.apply_async(do_pkg, [upload_id])
     pool.close()
 
-    p.wait(timeout=600)
+    #p.wait(timeout=600)
+    pool.join()
     for htmlfile in htmlfiles_to_process:
         with open(htmlfile, "w") as fd:
             fd.write(timeout_str)