/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: Jelmer Vernooij
  • Date: 2020-08-05 20:34:11 UTC
  • mfrom: (7490.40.87 work)
  • mto: (7490.40.103 work)
  • mto: This revision was merged to the branch mainline in revision 7521.
  • Revision ID: jelmer@jelmer.uk-20200805203411-cap9gp8vuwnz5lt7
Merge lp:brz/3.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
except ImportError as e:
61
61
    raise LaunchpadlibMissing(e)
62
62
 
 
63
from launchpadlib.credentials import RequestTokenAuthorizationEngine
63
64
from launchpadlib.launchpad import (
64
65
    Launchpad,
65
66
    )
106
107
        errors.BzrError.__init__(self, branch=branch, url=branch.base)
107
108
 
108
109
 
 
110
def get_auth_engine(base_url):
 
111
    return Launchpad.authorization_engine_factory(base_url, 'breezy')
 
112
 
 
113
 
 
114
def get_credential_store():
 
115
    return Launchpad.credential_store_factory(None)
 
116
 
 
117
 
109
118
def connect_launchpad(base_url, timeout=None, proxy_info=None,
110
119
                      version=Launchpad.DEFAULT_VERSION):
111
120
    """Log in to the Launchpad API.
119
128
        cache_directory = get_cache_directory()
120
129
    except EnvironmentError:
121
130
        cache_directory = None
 
131
    credential_store = get_credential_store()
 
132
    authorization_engine = get_auth_engine(base_url)
122
133
    return Launchpad.login_with(
123
134
        'breezy', base_url, cache_directory, timeout=timeout,
 
135
        credential_store=credential_store,
 
136
        authorization_engine=authorization_engine,
124
137
        proxy_info=proxy_info, version=version)
125
138
 
126
139