]> jfr.im git - z_archive/twitter.git/commitdiff
Agent feature was not actually working. Prepare fix for 1.0.1. Still waiting on Twitt...
authorMike Verdone <redacted>
Mon, 16 Feb 2009 07:45:35 +0000 (00:45 -0700)
committerMike Verdone <redacted>
Mon, 16 Feb 2009 07:45:35 +0000 (00:45 -0700)
twitter/api.py
twitter/cmdline.py

index 52db9739be8821be4b651f7ea93b5f62cb49290b..47dae5d3f19941340244b55f66e45fa463feeb33 100644 (file)
@@ -49,9 +49,9 @@ class TwitterCall(object):
         for action in _POST_ACTIONS:
             if self.uri.endswith(action):
                 method = "POST"
+                if (self.agent):
+                    kwargs["source"] = self.agent
                 break
-            if (self.agent):
-                kwargs["source"] = self.agent
         
         id = kwargs.pop('id', None)
         if id:
@@ -169,6 +169,6 @@ class Twitter(TwitterCall):
         """
         if (format not in ("json", "xml")):
             raise TwitterError("Unknown data format '%s'" %(format))
-        TwitterCall.__init__(self, email, password, format, domain)
+        TwitterCall.__init__(self, email, password, format, domain, "", agent)
 
 __all__ = ["Twitter", "TwitterError"]
index c75a89b3469253fbf3cf12fcebbd6d4bef504769..10c91d99a3e743dee1d757487ec7fd8f9a4af5d2 100644 (file)
@@ -49,7 +49,8 @@ from ConfigParser import SafeConfigParser
 
 from api import Twitter, TwitterError
 
-AGENT_STR = "Twitter Command-line Tool"
+# Wait on Twitter people to provide this string...
+AGENT_STR = None
 
 options = {
     'email': None,