]> jfr.im git - z_archive/twitter.git/commitdiff
use expanduser to support paths with ~
authorMike Verdone <redacted>
Mon, 31 May 2010 10:33:34 +0000 (12:33 +0200)
committerMike Verdone <redacted>
Mon, 31 May 2010 10:33:34 +0000 (12:33 +0200)
twitter/cmdline.py

index d722a6ace1b0bd845f49db70529854a3c879abb8..780837d8dd777b47de168e0f6027d8ca1b479b17 100644 (file)
@@ -479,8 +479,9 @@ def main(args=sys.argv[1:]):
         print >> sys.stderr
         raise SystemExit(1)
 
-    config_options = loadConfig(
+    config_path = os.path.expanduser(
         arg_options.get('config_filename') or OPTIONS.get('config_filename'))
+    config_options = loadConfig(config_path)
 
     # Apply the various options in order, the most important applied last.
     # Defaults first, then what's read from config file, then command-line
@@ -496,13 +497,15 @@ def main(args=sys.argv[1:]):
         print >> sys.stderr, "Use 'twitter -h' for help."
         return 1
 
+    oauth_filename = os.path.expanduser(options['oauth_filename'])
+
     if (options['action'] == 'authorize'
-        or not os.path.exists(options['oauth_filename'])):
+        or not os.path.exists(oauth_filename)):
         oauth_dance(
             "the Command-Line Tool", CONSUMER_KEY, CONSUMER_SECRET,
             options['oauth_filename'])
 
-    oauth_token, oauth_token_secret = read_token_file(options['oauth_filename'])
+    oauth_token, oauth_token_secret = read_token_file(oauth_filename)
     
     twitter = Twitter(
         auth=OAuth(