/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_directory.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-11-16 18:59:44 UTC
  • mfrom: (7143.15.15 more-cleanups)
  • Revision ID: breezy.the.bot@gmail.com-20181116185944-biefv1sub37qfybm
Sprinkle some PEP8iness.

Merged from https://code.launchpad.net/~jelmer/brz/more-cleanups/+merge/358611

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
        urlsplit.
60
60
        """
61
61
        return (scheme in ('bzr+ssh', 'sftp')
62
 
                and (netloc.endswith('launchpad.net')
63
 
                     or netloc.endswith('launchpad.dev')))
 
62
                and (netloc.endswith('launchpad.net') or
 
63
                     netloc.endswith('launchpad.dev')))
64
64
 
65
65
    def look_up(self, name, url):
66
66
        """See DirectoryService.look_up"""
83
83
            # messages.
84
84
            parts = path.split('/')
85
85
            if (len(parts) < 3
86
 
                or (parts[1] in ('ubuntu', 'debian') and len(parts) < 5)):
 
86
                    or (parts[1] in ('ubuntu', 'debian') and len(parts) < 5)):
87
87
                # This special case requires 5-parts to be valid.
88
88
                maybe_invalid = True
89
89
        else:
142
142
        if path.startswith('~/'):
143
143
            if lp_login is None:
144
144
                raise InvalidURL(path=url,
145
 
                    extra='Cannot resolve "~" to your username.'
146
 
                          ' See "bzr help launchpad-login"')
 
145
                                 extra='Cannot resolve "~" to your username.'
 
146
                                 ' See "bzr help launchpad-login"')
147
147
            path = '~' + lp_login + path[1:]
148
148
        return path
149
149
 
163
163
                result = self._resolve_via_xmlrpc(path, url, _request_factory)
164
164
                trace.note(gettext(
165
165
                    'resolution for {0}\n  local: {1}\n remote: {2}').format(
166
 
                           url, local_res['urls'], result['urls']))
 
166
                    url, local_res['urls'], result['urls']))
167
167
        else:
168
168
            result = self._resolve_via_xmlrpc(path, url, _request_factory)
169
169
 
182
182
                if _lp_login is None:
183
183
                    if not _warned_login:
184
184
                        trace.warning(
185
 
'You have not informed bzr of your Launchpad ID, and you must do this to\n'
186
 
'write to Launchpad or access private data.  See "bzr help launchpad-login".')
 
185
                            'You have not informed bzr of your Launchpad ID, and you must do this to\n'
 
186
                            'write to Launchpad or access private data.  See "bzr help launchpad-login".')
187
187
                        _warned_login = True
188
188
            else:
189
189
                # Use the URL if we can create a transport for it.