3
# Attempted reproduction for <http://pad.lv/742217>
8
from datetime import datetime, timedelta
9
from launchpadlib.launchpad import Launchpad
14
if len(sys.argv) != 2:
15
print "usage: %s PERSON_ID" % sys.argv[0]
18
lp = Launchpad.login_anonymously('reproduce bug 742217',
19
service_root='https://api.launchpad.net/')
22
person = lp.people[sys.argv[1]]
23
print 'got %s' % person
25
LIVE_STATUSES = ["New", "Incomplete", "Expired", "Confirmed", "Triaged",
26
"In Progress", "Fix Committed"]
27
TERMINAL_STATUSES = ["Fix Released"]
29
RELEVANT_STATUSES = LIVE_STATUSES + TERMINAL_STATUSES
31
CLOSED_BUG_RELEVANCE = 30
34
out = os.fdopen(1, 'w', 0)
37
def time_get_bugs(what, **params):
38
out.write('get bugs %s: ' % what)
40
coll = person.searchTasks(**params)
42
out.write('%s ' % b.bug_link.split('/')[-1])
43
out.write('\n %.3fs\n' % (time.time() - start))
46
time_get_bugs('all assigned',
47
status=RELEVANT_STATUSES,
51
time_get_bugs('live assigned',
55
cutoff = datetime.now() - timedelta(days=CLOSED_BUG_RELEVANCE)
56
time_get_bugs('terminal recently-closed assigned',
57
status=TERMINAL_STATUSES,
59
modified_since=cutoff)