~lifeless/bzr/index.range_map

« back to all changes in this revision

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

  • Committer: Robert Collins
  • Date: 2008-06-19 01:17:19 UTC
  • mfrom: (3218.1.277 +trunk)
  • Revision ID: robertc@robertcollins.net-20080619011719-1c4g4uxzzhdls2wf
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
104
104
            # TODO: if there's no registrant email perhaps we should
105
105
            # just connect anonymously?
106
106
            scheme, hostinfo, path = urlsplit(self.service_url)[:3]
107
 
            assert '@' not in hostinfo
108
 
            assert self.registrant_email is not None
109
 
            assert self.registrant_password is not None
 
107
            if '@' in hostinfo:
 
108
                raise AssertionError(hostinfo)
 
109
            if self.registrant_email is None:
 
110
                raise AssertionError()
 
111
            if self.registrant_password is None:
 
112
                raise AssertionError()
110
113
            # TODO: perhaps fully quote the password to make it very slightly
111
114
            # obscured
112
115
            # TODO: can we perhaps add extra Authorization headers
139
142
 
140
143
    def send_request(self, method_name, method_params, authenticated):
141
144
        proxy = self.get_proxy(authenticated)
142
 
        assert method_name
143
145
        method = getattr(proxy, method_name)
144
146
        try:
145
147
            result = method(*method_params)
205
207
                 author_email='',
206
208
                 product_name='',
207
209
                 ):
208
 
        assert branch_url, 'branch_url %r is invalid' % branch_url
 
210
        if not branch_url:
 
211
            raise errors.InvalidURL(branch_url, "You need to specify a non-empty branch URL.")
209
212
        self.branch_url = branch_url
210
213
        if branch_name:
211
214
            self.branch_name = branch_name
239
242
    _methodname = 'link_branch_to_bug'
240
243
 
241
244
    def __init__(self, branch_url, bug_id):
242
 
        assert branch_url
243
245
        self.bug_id = bug_id
244
246
        self.branch_url = branch_url
245
247
 
257
259
    _authenticated = False
258
260
 
259
261
    def __init__(self, path):
260
 
        assert path
 
262
        if not path:
 
263
            raise errors.InvalidURL(path=path,
 
264
                                    extra="You must specify a product.")
261
265
        self.path = path
262
266
 
263
267
    def _request_params(self):