/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: 2017-10-26 11:10:38 UTC
  • mfrom: (6791.2.7 python3)
  • Revision ID: jelmer@jelmer.uk-20171026111038-cvils4aykn7ffcju
Merge lp:~jelmer/brz/fix-imports.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
import httplib2
27
27
import os
28
28
import re
29
 
import urlparse
 
29
try:
 
30
    from urllib.parse import (
 
31
        urlparse,
 
32
        urlunparse,
 
33
        )
 
34
except ImportError:  # python < 3
 
35
    from urlparse import (
 
36
        urlparse,
 
37
        urlunparse,
 
38
        )
30
39
 
31
40
from ... import (
32
41
    branch,
293
302
 
294
303
def canonical_url(object):
295
304
    """Return the canonical URL for a branch."""
296
 
    scheme, netloc, path, params, query, fragment = urlparse.urlparse(
 
305
    scheme, netloc, path, params, query, fragment = urlparse(
297
306
        str(object.self_link))
298
307
    path = '/'.join(path.split('/')[2:])
299
308
    netloc = netloc.replace('api.', 'code.')
300
 
    return urlparse.urlunparse((scheme, netloc, path, params, query,
301
 
                                fragment))
 
309
    return urlunparse((scheme, netloc, path, params, query, fragment))