/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/plugins/propose/launchpad.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2019-01-24 01:55:52 UTC
  • mfrom: (7240.5.8 lp-refactoring)
  • Revision ID: breezy.the.bot@gmail.com-20190124015552-2cofvorutfgmzlp6
Some refactoring of the Launchpad module, ahead of removing xmlrpc support.

Merged from https://code.launchpad.net/~jelmer/brz/lp-refactoring/+merge/361934

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
lazy_import(globals(), """
43
43
from breezy.plugins.launchpad import (
44
44
    lp_api,
45
 
    lp_registration,
46
45
    )
47
46
""")
48
47
from ...transport import get_transport
149
148
    # https://bugs.launchpad.net/launchpad/+bug/397676
150
149
    supports_merge_proposal_labels = False
151
150
 
152
 
    def __init__(self, staging=False):
 
151
    def __init__(self):
153
152
        self._staging = staging
154
153
        if staging:
155
 
            lp_instance = 'staging'
 
154
            lp_base_url = lp_api.STAGING_SERVICE_ROOT
156
155
        else:
157
 
            lp_instance = 'production'
158
 
        self.launchpad = connect_launchpad(lp_instance)
 
156
            lp_base_url = None
 
157
        self.launchpad = lp_api.connect_launchpad(lp_base_url)
159
158
 
160
159
    def __repr__(self):
161
160
        return "Launchpad(staging=%s)" % self._staging
382
381
            yield LaunchpadMergeProposal(mp)
383
382
 
384
383
 
385
 
def connect_launchpad(lp_instance='production'):
386
 
    service = lp_registration.LaunchpadService(lp_instance=lp_instance)
387
 
    return lp_api.login(service, version='devel')
388
 
 
389
 
 
390
384
class LaunchpadBazaarMergeProposalBuilder(MergeProposalBuilder):
391
385
 
392
386
    def __init__(self, lp_host, source_branch, target_branch, message=None,