246
253
comments = bug.messages
248
lc = comments[len(comments)-1].owner
255
last_comment = comments[len(comments)-1].owner
257
last_comment = bug.owner
252
259
if release_name != "ubuntu":
253
260
release.add(release_name)
261
link = "https://launchpad.net/bugs/%s" % bug_number
262
time_in_queue = sponsors_subscribed_date(bug)
254
263
tasks.add(SponsoringItem(distribution=distribution,
256
link="https://launchpad.net/bugs/%s" % bug_number,
257
266
link_desc=bug_number,
270
last_comment=last_comment,
262
271
status=task.status,
263
272
importance=task.importance,
265
274
tags=set(bug.tags),
266
275
date_created=bug.date_created,
267
time_in_queue=sponsors_subscribed_date(bug),
276
time_in_queue=time_in_queue,
268
277
verbose=verbose))
298
308
url = re.sub("https://api\.edge\.launchpad\.net/[^/]+/",
299
309
"https://code.launchpad.net/", proposal.self_link)
300
if not filter(lambda a: a.link == url, tasks):
310
if not [a for a in tasks if a.link == url]:
301
311
comments = [a for a in proposal.all_comments]
303
313
status = ["%s comments" % (len(comments))]
304
314
last_comment = comments[-1].author
306
316
last_comment = proposal.registrant
307
votes = filter(lambda a: a.comment!=None, proposal.votes)
317
votes = [a for a in proposal.votes if a.comment is not None]
309
status += map(lambda a: a.comment.vote, votes)
319
status += [a.comment.vote for a in votes]
320
title = proposal.source_branch.display_name
310
321
tasks.add(SponsoringItem(distribution=distribution,
351
362
packages = launchpad.get_packagesets(lp, distribution)
352
363
devs = [a.name for a in lp.people["ubuntu-dev"].participants]
353
364
date = subprocess.Popen(["date", "-R"], stdout=subprocess.PIPE)
354
html = """<?xml version="1.0" encoding="utf-8" ?>
355
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
356
<html xmlns="http://www.w3.org/1999/xhtml">
358
<style type='text/css' media='screen'>@import url(launchpad.css);</style>
359
<style type='text/css' media='screen'>@import url(sponsoring.css);</style>
360
<script type='text/javascript' src='sorttable.js'></script>
361
<title>Sponsoring Overview</title>
364
<table border='1' id='icons' class='sortable'>
365
<caption>Last updated at: <i>%s</i></caption>""" % date.communicate()[0].strip()
368
<th>Time in Queue</th>
372
<th>Source Package</th>
374
<th>Last Comment</th>
378
<th>Date Created</th>
366
subst["LAST_UPDATED"] = date.communicate()[0].strip()
380
368
for item in sponsoring_items:
383
html+=item.html(devs, packages)
389
<p>Total requests: %i</p>
391
<h2>Request types</h2>
393
<li>sync requests: %i</li>
394
<li>merge requests: %i</li>
395
<li>upgrade requests: %i</li>
396
<li>SRU requests: %i</li>
397
<li>other requests: %i</li>
398
</ul>""" % (len(sponsoring_items),
399
len(filter(lambda x: x.is_sync(), sponsoring_items)),
400
len(filter(lambda x: x.is_merge(), sponsoring_items)),
401
len(filter(lambda x: x.is_upgrade(), sponsoring_items)),
402
len(filter(lambda x: x.is_sru(), sponsoring_items)),
403
len(filter(lambda x: not (x.is_sync() or x.is_merge() or x.is_upgrade() or x.is_sru()), sponsoring_items)))
406
<h2>Target components</h2>
409
<li>restricted: %i</li>
410
<li>universe: %i</li>
411
<li>multiverse: %i</li>
414
<h2>Package Sets</h2>
416
""" % (len(filter(lambda x: "main" in x.get_components(), sponsoring_items)),
417
len(filter(lambda x: "restricted" in x.get_components(), sponsoring_items)),
418
len(filter(lambda x: "universe" in x.get_components(), sponsoring_items)),
419
len(filter(lambda x: "multiverse" in x.get_components(), sponsoring_items)))
369
subst["TABLE"] += item.html(devs, packages)
370
subst["TOTAL"] = len(sponsoring_items)
371
subst["SYNCS"] = len([x for x in sponsoring_items if x.is_sync()])
372
subst["MERGES"] = len([x for x in sponsoring_items if x.is_merge()])
373
subst["UPGRADES"] = len([x for x in sponsoring_items if x.is_upgrade()])
374
subst["SRUS"] = len([x for x in sponsoring_items if x.is_sru()])
375
subst["OTHERS"] = len([x for x in sponsoring_items
376
if not (x.is_sync() or x.is_merge() or
377
x.is_upgrade() or x.is_sru())])
378
subst["MAIN"] = len([x for x in sponsoring_items
379
if "main" in x.get_components()])
380
subst["RESTRICTED"] = len([x for x in sponsoring_items
381
if "restricted" in x.get_components()])
382
subst["UNIVERSE"] = len([x for x in sponsoring_items
383
if "universe" in x.get_components()])
384
subst["MULTIVERSE"] = len([x for x in sponsoring_items
385
if "multiverse" in x.get_components()])
386
subst["PACKAGE_SETS"] = ""
420
387
packageset_dict = get_packageset_dict(sponsoring_items, packages)
421
388
for packageset in sorted(packageset_dict):
422
html += " <li>%s: %i</li>\n" % (packageset, packageset_dict[packageset])
425
<p><a href="http://reports.qa.ubuntu.com/reports/sponsoring-stats/">More sponsoring stats</a></p>
429
<h2><i>Last Comment</i> column</h2>
431
<li><b>Ubuntu Developer, who can upload the package in question</b></li>
432
<li><i>Ubuntu Developer, who can't upload the package in question</i></li>
434
<h2><i>Type</i> column</h2>
436
<li>Sync: <a href='https://wiki.ubuntu.com/SyncRequestProcess'>Sync Procedure</a></li>
437
<li>Merge: <a href='https://wiki.ubuntu.com/UbuntuDevelopment/Merging'>Merge Procedure</a></li>
438
<li>SRU: <a href='https://wiki.ubuntu.com/StableReleaseUpdates'>Stable Release Update</a></li>
443
<li><a href="https://wiki.ubuntu.com/SponsorshipProcess">Documentation about the sponsorship process</a></li>
444
<li><a href="https://wiki.ubuntu.com/UbuntuDevelopment/CodeReviews">Documentation about doing code reviews</a></li>
446
<p><b><a href="https://launchpad.net/ubuntu-sponsoring">Help making this Sponsorship Overview better.</a></b></p>
447
<p style="font-size: x-small"><a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.1</a></p>
389
subst["PACKAGE_SETS"] += " <li>%s: %i</li>\n" % \
390
(packageset, packageset_dict[packageset])
392
html = open("template.html").read()
393
for pattern, substitution in subst.iteritems():
394
html = re.sub("@" + pattern + "@", str(substitution), html)
450
396
if os.path.exists("index.html"):
451
397
os.remove("index.html")
452
398
f = open("index.html", "w")