18
18
from urlparse import urlsplit, urlunsplit
19
19
from urllib import unquote, quote
21
## from twisted.web import xmlrpc
24
# TODO: use last component of path as default id?
23
# TODO: use last component of the branch's url as the default id?
25
# TODO: Allow server url to be overridden by an environment variable for
26
# testing; similarly for user email and password.
26
28
class BranchRegistrationRequest(object):
27
29
"""Request to tell Launchpad about a bzr branch."""
29
31
_methodname = 'register_branch'
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
33
DEFAULT_SERVICE_URL = 'http://xmlrpc.launchpad.net/branch/'
35
DEFAULT_SERVICE_URL = 'http://xmlrpc.launchpad.net/bazaar/'
37
# None means to use the xmlrpc default, which is almost always what you
38
# want. But it might be useful for testing.
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'