handle IndexError in getpcu
[monitor.git] / statistics / rtinfo.py
1 #!/usr/bin/python
2
3 from monitor import database
4
5 sql = database.dbLoad("idTickets")
6 import sys
7
8 sortkeys = {}
9 print      "Queue     lastupdated     Status      Email          OwnerID Subject"
10 for id in sql.keys(): 
11         #print sql[id].keys()
12         #sys.exit(1)
13         key = "%(queue)s-%(owner)s-%(status)s-%(lastupdated)s-%(email)-30s-%(subj)s" % sql[id]
14         sortkeys[key] = "%(ticket_id)s %(queue)s %(lastupdated)s %(status)6s %(email)-25s %(owner)6s %(subj)26.26s https://rt.planet-lab.org/Ticket/Display.html?id=%(ticket_id)s" % sql[id]
15         #sortkeys[key] = "%(ticket_id)s %(status)6s %(email)-30s %(lastupdated)s %(subj)s" % sql[id]
16
17 keys = sortkeys.keys()
18 keys.sort()
19 for key in keys:
20         print sortkeys[key]