/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/launchpad/lp_api.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-06-01 21:57:00 UTC
  • mfrom: (7490.39.3 move-launchpad)
  • Revision ID: breezy.the.bot@gmail.com-20200601215700-joxuzo6w172gq74v
Move launchpad hoster support to the launchpad plugin.

Merged from https://code.launchpad.net/~jelmer/brz/move-launchpad/+merge/384931

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
except ImportError as e:
53
53
    raise LaunchpadlibMissing(e)
54
54
 
55
 
from launchpadlib.credentials import RequestTokenAuthorizationEngine
56
55
from launchpadlib.launchpad import (
57
56
    Launchpad,
58
57
    )
99
98
        errors.BzrError.__init__(self, branch=branch, url=branch.base)
100
99
 
101
100
 
102
 
def get_auth_engine(base_url):
103
 
    return Launchpad.authorization_engine_factory(base_url, 'breezy')
104
 
 
105
 
 
106
 
def get_credential_store():
107
 
    return Launchpad.credential_store_factory(None)
108
 
 
109
 
 
110
101
def connect_launchpad(base_url, timeout=None, proxy_info=None,
111
102
                      version=Launchpad.DEFAULT_VERSION):
112
103
    """Log in to the Launchpad API.
120
111
        cache_directory = get_cache_directory()
121
112
    except EnvironmentError:
122
113
        cache_directory = None
123
 
    credential_store = get_credential_store()
124
 
    authorization_engine = get_auth_engine(base_url)
125
114
    return Launchpad.login_with(
126
115
        'breezy', base_url, cache_directory, timeout=timeout,
127
 
        credential_store=credential_store,
128
 
        authorization_engine=authorization_engine,
129
116
        proxy_info=proxy_info, version=version)
130
117
 
131
118