~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2012-03-13 17:25:29 UTC
  • mfrom: (6499 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6501.
  • Revision ID: v.ladeuil+lp@free.fr-20120313172529-i0suyjnepsor25i7
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
 
18
17
"""Directory lookup that uses Launchpad."""
19
18
 
 
19
from __future__ import absolute_import
 
20
 
20
21
from urlparse import urlsplit
21
22
import xmlrpclib
22
23
 
26
27
    trace,
27
28
    transport,
28
29
    )
 
30
from bzrlib.i18n import gettext
29
31
 
30
32
from bzrlib.plugins.launchpad.lp_registration import (
31
33
    LaunchpadService, ResolveLaunchpadPathRequest)
130
132
            else:
131
133
                # There are either 0 or > 2 path parts, neither of which is
132
134
                # supported for these schemes.
133
 
                raise errors.InvalidURL('Bad path: %s' % result.path)
 
135
                raise errors.InvalidURL('Bad path: %s' % url)
134
136
            # Expand any series shortcuts, but keep unknown series.
135
137
            series = distro_series.get(series, series)
136
138
            # Hack the url and let the following do the final resolution.
164
166
            if 'launchpad' in debug.debug_flags:
165
167
                local_res = result
166
168
                result = self._resolve_via_xmlrpc(path, url, _request_factory)
167
 
                trace.note('resolution for %s\n  local: %s\n remote: %s'
168
 
                           % (url, local_res['urls'], result['urls']))
 
169
                trace.note(gettext(
 
170
                    'resolution for {0}\n  local: {1}\n remote: {2}').format(
 
171
                           url, local_res['urls'], result['urls']))
169
172
        else:
170
173
            result = self._resolve_via_xmlrpc(path, url, _request_factory)
171
174