/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: 2019-06-03 23:48:08 UTC
  • mfrom: (7316 work)
  • mto: This revision was merged to the branch mainline in revision 7328.
  • Revision ID: jelmer@jelmer.uk-20190603234808-15yk5c7054tj8e2b
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
 
38
38
from ... import (
39
39
    branch,
40
 
    bedding,
 
40
    config,
41
41
    errors,
42
42
    osutils,
43
43
    trace,
69
69
MINIMUM_LAUNCHPADLIB_VERSION = (1, 6, 3)
70
70
 
71
71
 
 
72
# We use production as the default because edge has been deprecated circa
 
73
# 2010-11 (see bug https://bugs.launchpad.net/bzr/+bug/583667)
 
74
DEFAULT_INSTANCE = 'production'
 
75
 
 
76
LAUNCHPAD_DOMAINS = {
 
77
    'production': 'launchpad.net',
 
78
    'staging': 'staging.launchpad.net',
 
79
    'qastaging': 'qastaging.launchpad.net',
 
80
    'demo': 'demo.launchpad.net',
 
81
    'dev': 'launchpad.test',
 
82
    }
 
83
 
 
84
LAUNCHPAD_BAZAAR_DOMAINS = [
 
85
    'bazaar.%s' % domain
 
86
    for domain in LAUNCHPAD_DOMAINS.values()]
 
87
 
 
88
 
72
89
def get_cache_directory():
73
90
    """Return the directory to cache launchpadlib objects in."""
74
 
    return osutils.pathjoin(bedding.cache_dir(), 'launchpad')
 
91
    return osutils.pathjoin(config.config_dir(), 'launchpad')
75
92
 
76
93
 
77
94
def parse_launchpadlib_version(version_number):
115
132
    if proxy_info is None:
116
133
        import httplib2
117
134
        proxy_info = httplib2.proxy_info_from_environment('https')
118
 
    try:
119
 
        cache_directory = get_cache_directory()
120
 
    except EnvironmentError:
121
 
        cache_directory = None
 
135
    cache_directory = get_cache_directory()
122
136
    return Launchpad.login_with(
123
137
        'breezy', base_url, cache_directory, timeout=timeout,
124
138
        proxy_info=proxy_info, version=version)