~brian-murray/ubuntu-sponsoring/bug-833706

« back to all changes in this revision

Viewing changes to sponsors-page.py

  • Committer: Iain Lane
  • Date: 2015-07-20 11:08:26 UTC
  • Revision ID: iain.lane@canonical.com-20150720110826-upyf47lhyhzithgk
Allow teams to be able to be collected together

use this to grab unity-control-center and unity-settings-daemon for the desktop team

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
 
TEAMS = (
17
 
    "ubuntu-branches",
18
 
    "ubuntu-sponsors",
19
 
    "ubuntu-dev",
20
 
    "ubuntu-core-dev",
21
 
    "ubuntu-packaging-guide-team",
22
 
    "ubuntu-desktop",
23
 
)
 
16
TEAMS = {
 
17
    "ubuntu-branches": None,
 
18
    "ubuntu-sponsors": None,
 
19
    "ubuntu-dev": None,
 
20
    "ubuntu-core-dev": None,
 
21
    "ubuntu-packaging-guide-team": None,
 
22
    "ubuntu-desktop": None,
 
23
    "unity-settings-daemon-team": "ubuntu-desktop",
 
24
    "unity-control-center-team": "ubuntu-desktop",
 
25
}
24
26
 
25
27
SPONSOR_TEAMS = {
26
28
    "general":  "ubuntu-sponsors",
93
95
        self.components = None
94
96
        self.sets = None
95
97
        if verbose:
96
 
            print "Added %s: %s" % (self.package, self.link)
 
98
            print "Added %s: %s for %s" % (self.package, self.link, self.team)
97
99
 
98
100
    def is_sync(self):
99
101
        """Returns true if the sponsoring item is a sync request."""
496
498
    lp = launchpad.lp_login()
497
499
    distribution = lp.distributions['ubuntu']
498
500
    sponsoring_items = dict()
499
 
    for team in SPONSOR_TEAMS.keys():
 
501
    for team in SPONSOR_TEAMS:
500
502
        sponsoring_items[team] = get_bugs(lp, distribution, team, options.verbose)
501
503
    for team in TEAMS:
502
 
        sponsoring_items[team] = sponsoring_items.get(team, set()) | \
503
 
            get_branches(lp, distribution, team, options.verbose)
 
504
        output_team = TEAMS.get(team, None) or team
 
505
        branches =  get_branches(lp, distribution, team, options.verbose)
 
506
        sponsoring_items[output_team] = sponsoring_items.get(output_team, set()) | \
 
507
                branches
504
508
    all_sponsoring_items = list(set.union(*sponsoring_items.values()))
505
509
    all_sponsoring_items.sort(key=operator.methodcaller("get_time_in_queue"))
506
510
    packages = launchpad.get_packagesets(lp, distribution)