finished porting hugdaylist from launchpadbugs to launchpadlib

This commit is contained in:
Markus Korn 2009-01-05 10:29:14 +01:00
parent 7439db8d3b
commit 920971eaa7

View File

@ -35,7 +35,7 @@ import string
import sys
from optparse import OptionParser
from common import get_launchpad, translate_web_api
from common import get_launchpad, translate_web_api, translate_api_web
def check_args():
howmany = -1
@ -67,16 +67,19 @@ def check_args():
return (howmany, url)
def filter_unsolved(b):
bug = launchpad.bugs[int(b)]
def filter_unsolved(task):
# TODO: don't use this filter here, only check status and assignee of
# the given task
# Filter out special types of bugs:
# - https://wiki.ubuntu.com/Bugs/HowToTriage#Special%20types%20of%20bugs
return filter(lambda a: a.status != 'Fix Committed' and \
(a.assignee in ['motu','desktop-bugs'] or \
not a.assignee), bug.infotable) and \
'ubuntu-main-sponsors' not in [str(s) for s in bug.subscribers] and \
'ubuntu-universe-sponsors' not in [str(s) for s in bug.subscribers] and \
'ubuntu-archive' not in [str(s) for s in bug.subscribers]
subscriptions = set(s.person.name for s in task.bug.subscriptions) #this is expensive, parse name out of self_link instead?
if (task.status != "Fix Committed" and
(not task.assignee or task.assignee.name in ['motu','desktop-bugs']) and
'ubuntu-main-sponsors' not in subscriptions and
'ubuntu-universe-sponsors' not in subscriptions and
'ubuntu-archive' not in subscriptions):
return True
return False
def main():
(howmany, url) = check_args()
@ -116,13 +119,14 @@ def main():
|| Bug || Subject || Triager ||"""
for i in list(l)[:howmany]:
bug = i.bug
print '||<rowbgcolor="#FFEBBB"> [%s %s] || %s || ||' % \
(i.url, i.bugnumber, i.summary)
(translate_api_web(bug.self_link), bug.id, bug.title)
if __name__ == '__main__':
try:
main()
main()
except KeyboardInterrupt:
print >> sys.stderr, "Aborted."
sys.exit(1)