X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fqueue_report.py;h=5e164285d8372599d8537bc922f644a77a99393c;hb=c8182c171aa569945e899566fdf6492cfb166d71;hp=9c349892cea4f68c8e82d11ace13d222c903027c;hpb=5c7286abf3ff316a802de2b41d246a07f6b04257;p=dak.git diff --git a/dak/queue_report.py b/dak/queue_report.py index 9c349892..5e164285 100755 --- a/dak/queue_report.py +++ b/dak/queue_report.py @@ -37,13 +37,18 @@ from copy import copy import glob, os, stat, sys, time import apt_pkg +try: + import rrdtool +except ImportError: + pass from daklib import utils -from daklib.queue import Upload -from daklib.dbconn import DBConn, has_new_comment, DBChange, DBSource, get_uid_from_fingerprint +from daklib.dbconn import DBConn, DBSource, has_new_comment, PolicyQueue, \ + get_uid_from_fingerprint +from daklib.policy import PolicyQueueUploadHandler from daklib.textutils import fix_maintainer +from daklib.utils import get_logins_from_ldap from daklib.dak_exceptions import * -import debianbts Cnf = None direction = [] @@ -53,7 +58,7 @@ row_number = 0 def usage(exit_code=0): print """Usage: dak queue-report -Prints a report of packages in queue directories (usually new and byhand). +Prints a report of packages in queues (usually new and byhand). -h, --help show this help and exit. -8, --822 writes 822 formated output to the location set in dak.conf @@ -61,6 +66,7 @@ Prints a report of packages in queue directories (usually new and byhand). -s, --sort=key sort output according to key, see below. -a, --age=key if using sort by age, how should time be treated? If not given a default of hours will be used. + -r, --rrd=key Directory where rrd files to be updated are stored -d, --directories=key A comma seperated list of queues to be scanned Sorting Keys: ao=age, oldest first. an=age, newest first. @@ -111,7 +117,15 @@ def time_pp(x): def sg_compare (a, b): a = a[1] b = b[1] - """Sort by have note, time of oldest upload.""" + """Sort by have pending action, have note, time of oldest upload.""" + # Sort by have pending action + a_note_state = a["processed"] + b_note_state = b["processed"] + if a_note_state < b_note_state: + return -1 + elif a_note_state > b_note_state: + return 1 + # Sort by have note a_note_state = a["note_state"] b_note_state = b["note_state"] @@ -169,11 +183,12 @@ def header(): - + Debian NEW and BYHAND Packages
- corner image - corner image - corner image - corner image Debian NEW and BYHAND Packages @@ -218,12 +234,13 @@ def header(): def footer(): print "

Timestamp: %s (UTC)

" % (time.strftime("%d.%m.%Y / %H:%M:%S", time.gmtime())) + print "

There are graphs about the queues available.

" print """