/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-07-28 02:11:05 UTC
  • mfrom: (7490.40.78 work)
  • mto: This revision was merged to the branch mainline in revision 7520.
  • Revision ID: jelmer@jelmer.uk-20200728021105-fzq7g6f8bl1g0aet
Merge lp:brz/3.1.

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
55
56
from launchpadlib.launchpad import (
56
57
    Launchpad,
57
58
    )
98
99
        errors.BzrError.__init__(self, branch=branch, url=branch.base)
99
100
 
100
101
 
 
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
 
101
110
def connect_launchpad(base_url, timeout=None, proxy_info=None,
102
111
                      version=Launchpad.DEFAULT_VERSION):
103
112
    """Log in to the Launchpad API.
111
120
        cache_directory = get_cache_directory()
112
121
    except EnvironmentError:
113
122
        cache_directory = None
 
123
    credential_store = get_credential_store()
 
124
    authorization_engine = get_auth_engine(base_url)
114
125
    return Launchpad.login_with(
115
126
        'breezy', base_url, cache_directory, timeout=timeout,
 
127
        credential_store=credential_store,
 
128
        authorization_engine=authorization_engine,
116
129
        proxy_info=proxy_info, version=version)
117
130
 
118
131