~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-09-01 08:02:42 UTC
  • mfrom: (5390.3.3 faster-revert-593560)
  • Revision ID: pqm@pqm.ubuntu.com-20100901080242-esg62ody4frwmy66
(spiv) Avoid repeatedly calling self.target.all_file_ids() in
 InterTree.iter_changes. (Andrew Bennetts)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2011 Canonical Ltd
 
1
# Copyright (C) 2006-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
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
 
from __future__ import absolute_import
18
 
 
19
17
 
20
18
import os
21
19
import socket
56
54
class XMLRPCTransport(xmlrpclib.Transport):
57
55
 
58
56
    def __init__(self, scheme):
59
 
        xmlrpclib.Transport.__init__(self)
 
57
        # In python2.4 xmlrpclib.Transport is a old-style class, and does not
 
58
        # define __init__, so we check first
 
59
        init = getattr(xmlrpclib.Transport, '__init__', None)
 
60
        if init is not None:
 
61
            init(self)
60
62
        self._scheme = scheme
61
63
        self._opener = _urllib2_wrappers.Opener()
62
64
        self.verbose = 0
84
86
 
85
87
    LAUNCHPAD_DOMAINS = {
86
88
        'production': 'launchpad.net',
 
89
        'edge': 'edge.launchpad.net',
87
90
        'staging': 'staging.launchpad.net',
88
 
        'qastaging': 'qastaging.launchpad.net',
89
91
        'demo': 'demo.launchpad.net',
90
92
        'dev': 'launchpad.dev',
91
93
        }
96
98
    for instance, domain in LAUNCHPAD_DOMAINS.iteritems():
97
99
        LAUNCHPAD_INSTANCE[instance] = 'https://xmlrpc.%s/bazaar/' % domain
98
100
 
99
 
    # We use production as the default because edge has been deprecated circa
100
 
    # 2010-11 (see bug https://bugs.launchpad.net/bzr/+bug/583667)
 
101
    # Previously 'edge' was used to avoid a launchpad bug with redirection
101
102
    DEFAULT_INSTANCE = 'production'
102
103
    DEFAULT_SERVICE_URL = LAUNCHPAD_INSTANCE[DEFAULT_INSTANCE]
103
104
 
164
165
            # the url?  perhaps a bit more secure against accidentally
165
166
            # revealing it.  std66 s3.2.1 discourages putting the
166
167
            # password in the url.
167
 
            hostinfo = '%s:%s@%s' % (urlutils.quote(self.registrant_email),
168
 
                                     urlutils.quote(self.registrant_password),
 
168
            hostinfo = '%s:%s@%s' % (urllib.quote(self.registrant_email),
 
169
                                     urllib.quote(self.registrant_password),
169
170
                                     hostinfo)
170
171
            url = urlunsplit((scheme, hostinfo, path, '', ''))
171
172
        else: