~laney/ubuntu-sponsoring/per-team

« back to all changes in this revision

Viewing changes to sponsors-page.py

  • Committer: Iain Lane
  • Date: 2015-09-15 12:33:22 UTC
  • Revision ID: iain.lane@canonical.com-20150915123322-3ntlouycc0mxytnp
Map from packagesets to teams

So that we can populate individual teams' pages with items in packages they
look after.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
from lazr.restfulclient.errors import ServerError
14
14
import launchpad
15
15
 
 
16
# { a : b }
 
17
# Look for merge proposals / bug subcriptions for a and output them to b's
 
18
# page.
16
19
TEAMS = {
17
20
    "ubuntu-branches": None,
18
21
    "ubuntu-sponsors": None,
24
27
    "unity-control-center-team": "ubuntu-desktop",
25
28
}
26
29
 
 
30
# { a : b }
 
31
# Items against packages in sets in b should go to a's page
 
32
SETS = {
 
33
    "desktop-core": "ubuntu-desktop",
 
34
    "kubuntu": "kubuntu-dev",
 
35
    "ubuntu-desktop": "ubuntu-desktop",
 
36
    "ubuntu-server": "ubuntu-server-dev",
 
37
}
 
38
 
27
39
SPONSOR_TEAMS = {
28
40
    "general":  "ubuntu-sponsors",
29
41
    "security": "ubuntu-security-sponsors"
506
518
        sponsoring_items[output_team] = sponsoring_items.get(output_team, set()) | \
507
519
                branches
508
520
    all_sponsoring_items = list(set.union(*sponsoring_items.values()))
 
521
 
 
522
    interesting_sets = set(SETS.keys())
 
523
 
509
524
    packages = launchpad.get_packagesets(lp, distribution)
 
525
 
 
526
    for item in all_sponsoring_items:
 
527
        sets = item.get_sets(packages) & interesting_sets
 
528
        if sets:
 
529
            for s in sets:
 
530
                sponsoring_items.get(SETS[s], set()).add(item)
 
531
 
510
532
    devs = [a.name for a in lp.people["ubuntu-dev"].participants]
511
533
 
512
534
    generate_page(all_sponsoring_items, devs, packages, sponsoring_items.keys())