]> jfr.im git - z_archive/twitter.git/blobdiff - twitter/oauth.py
Refactor: move oauth dance and token file r/w to other modules.
[z_archive/twitter.git] / twitter / oauth.py
index a839bb6a9e7303980a166b925462b8bb1df89e2c..75ac3e34be17345ed0fd68032c283a9ca06de646 100644 (file)
@@ -8,6 +8,17 @@ import hashlib
 import hmac
 
 
+def write_token_file(filename, oauth_token, oauth_token_secret):
+    oauth_file = open(filename, 'w')
+    print >> oauth_file, oauth_token
+    print >> oauth_file, oauth_token_secret
+    oauth_file.close()
+
+def read_token_file(filename):
+    f = open(filename)
+    return f.readline().strip(), f.readline().strip()
+
+
 class OAuth(Auth):
     """
     An OAuth authenticator.