~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2008-01-29 08:40:53 UTC
  • mto: (3206.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 3207.
  • Revision ID: v.ladeuil+lp@free.fr-20080129084053-sunwf549ox6zczqr
Fix two more leaked log files.

* bzrlib/tests/test_http.py:
(TestHttpProxyWhiteBox.tearDown): Call the base class tearDown.

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
        if netloc != '':
63
63
            raise errors.InvalidURL(path=base)
64
64
 
 
65
    def _requires_launchpad_login(self, scheme, netloc, path, query,
 
66
                                  fragment):
 
67
        """Does the URL require a Launchpad login in order to be reached?
 
68
 
 
69
        The URL is specified by its parsed components, as returned from
 
70
        urlsplit.
 
71
        """
 
72
        return (scheme in ('bzr+ssh', 'sftp')
 
73
                and (netloc.endswith('launchpad.net')
 
74
                     or netloc.endswith('launchpad.dev')))
 
75
 
65
76
    def _resolve(self, abspath,
66
77
                 _request_factory=ResolveLaunchpadPathRequest,
67
78
                 _lp_login=None):
83
94
            _lp_login = get_lp_login()
84
95
        for url in result['urls']:
85
96
            scheme, netloc, path, query, fragment = urlsplit(url)
86
 
            if scheme == 'bzr+ssh' and (netloc.endswith('launchpad.net') or
87
 
                                        netloc.endswith('launchpad.dev')):
 
97
            if self._requires_launchpad_login(scheme, netloc, path, query,
 
98
                                              fragment):
88
99
                # Only accept launchpad.net bzr+ssh URLs if we know
89
100
                # the user's Launchpad login:
90
101
                if _lp_login is None: