/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to breezy/plugins/launchpad/lp_directory.py

Merge trunk, address review comments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
from ...i18n import gettext
31
31
 
32
32
from .lp_registration import (
33
 
    LaunchpadService, ResolveLaunchpadPathRequest)
 
33
    InvalidURL,
 
34
    LaunchpadService,
 
35
    ResolveLaunchpadPathRequest,
 
36
    )
34
37
from .account import get_lp_login
35
38
 
36
39
 
99
102
        try:
100
103
            result = resolve.submit(service)
101
104
        except xmlrpclib.Fault as fault:
102
 
            raise errors.InvalidURL(
 
105
            raise InvalidURL(
103
106
                path=url, extra=fault.faultString)
104
107
        return result
105
108
 
132
135
            else:
133
136
                # There are either 0 or > 2 path parts, neither of which is
134
137
                # supported for these schemes.
135
 
                raise errors.InvalidURL('Bad path: %s' % url)
 
138
                raise InvalidURL('Bad path: %s' % url)
136
139
            # Expand any series shortcuts, but keep unknown series.
137
140
            series = distro_series.get(series, series)
138
141
            # Hack the url and let the following do the final resolution.
146
149
    def _expand_user(self, path, url, lp_login):
147
150
        if path.startswith('~/'):
148
151
            if lp_login is None:
149
 
                raise errors.InvalidURL(path=url,
 
152
                raise InvalidURL(path=url,
150
153
                    extra='Cannot resolve "~" to your username.'
151
154
                          ' See "bzr help launchpad-login"')
152
155
            path = '~' + lp_login + path[1:]
199
202
                else:
200
203
                    break
201
204
        else:
202
 
            raise errors.InvalidURL(path=url, extra='no supported schemes')
 
205
            raise InvalidURL(path=url, extra='no supported schemes')
203
206
        return url
204
207
 
205
208