We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 0132f826 authored by Daniel Watkins's avatar Daniel Watkins

Client code can be customised.

parent 2ab6e976
......@@ -16,9 +16,10 @@ class GobbleException(Exception):
class GobbleServer(object):
def __init__(self, server_name, username, password):
def __init__(self, server_name, username, password, client_code='imp'):
if server_name[:7] != "http://":
server_name = "http://%s" % (server_name,)
self.client_code = client_code
self.name = server_name
self.password = password
self.post_data = []
......@@ -32,9 +33,11 @@ class GobbleServer(object):
timestamp = int(time.time())
token = (md5hash(md5hash(self.password).hexdigest()
+ str(timestamp)).hexdigest())
auth_url = "%s/?hs=true&p=1.2&u=%s&t=%d&a=%s&c=imp" % (self.name,
self.username,
timestamp, token)
auth_url = "%s/?hs=true&p=1.2&u=%s&t=%d&a=%s&c=%s" % (self.name,
self.username,
timestamp,
token,
self.client_code)
response = urlopen(auth_url).read()
lines = response.split("\n")
if lines[0] != "OK":
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment