librefm-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Librefm-commits] [1433] Client code can be customised.


From: Daniel Watkins
Subject: [Librefm-commits] [1433] Client code can be customised.
Date: Sat, 09 May 2009 12:56:40 +0000

Revision: 1433
          http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1433
Author:   odd_bloke
Date:     2009-05-09 12:56:39 +0000 (Sat, 09 May 2009)
Log Message:
-----------
Client code can be customised.

Modified Paths:
--------------
    trunk/scripts/gobble.py

Modified: trunk/scripts/gobble.py
===================================================================
--- trunk/scripts/gobble.py     2009-05-09 10:21:10 UTC (rev 1432)
+++ trunk/scripts/gobble.py     2009-05-09 12:56:39 UTC (rev 1433)
@@ -16,9 +16,10 @@
 
 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 @@
         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":





reply via email to

[Prev in Thread] Current Thread [Next in Thread]