~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to lp_registration.py

  • Committer: Martin Pool
  • Date: 2006-03-22 18:40:34 UTC
  • mto: (1668.1.8 bzr-0.8.mbp)
  • mto: This revision was merged to the branch mainline in revision 1710.
  • Revision ID: mbp@sourcefrog.net-20060322184034-42a088c76600c769
Update xmlrpc api to pass product name as a parameter.
Add new stubbed-out test.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
from urlparse import urlsplit, urlunsplit
19
19
from urllib import unquote, quote
20
20
import xmlrpclib
21
 
## from twisted.web import xmlrpc
22
 
 
23
 
 
24
 
# TODO: use last component of path as default id?
 
21
 
 
22
 
 
23
# TODO: use last component of the branch's url as the default id?
 
24
 
 
25
# TODO: Allow server url to be overridden by an environment variable for
 
26
# testing; similarly for user email and password.
25
27
 
26
28
class BranchRegistrationRequest(object):
27
29
    """Request to tell Launchpad about a bzr branch."""
28
30
 
29
31
    _methodname = 'register_branch'
30
32
 
31
 
    # NB this should always end in a slash to avoid xmlrpclib appending
 
33
    # NB: this should always end in a slash to avoid xmlrpclib appending
32
34
    # '/RPC2'
33
 
    DEFAULT_SERVICE_URL = 'http://xmlrpc.launchpad.net/branch/'
 
35
    DEFAULT_SERVICE_URL = 'http://xmlrpc.launchpad.net/bazaar/'
 
36
 
 
37
    # None means to use the xmlrpc default, which is almost always what you
 
38
    # want.  But it might be useful for testing.
34
39
 
35
40
    def __init__(self, branch_url, branch_id):
36
41
        self.branch_url = branch_url
37
42
        self.branch_id = branch_id
38
43
        self.branch_description = ''
39
44
        self.owner_email = ''
 
45
        self.product_name = ''
40
46
        self.service_url = self.DEFAULT_SERVICE_URL
41
47
        self.registrant = 'testuser@launchpad.net'
42
48
        self.password = 'testpassword'
49
55
                self.branch_id,
50
56
                self.branch_description,
51
57
                self.owner_email,
 
58
                self.product_name,
52
59
               )
53
60
 
54
61
    def submit(self, transport=None):