]> jfr.im git - z_archive/twitter.git/commitdiff
Merge pull request #111 from ccosby/ForceAnsi
authorMike Verdone <redacted>
Sun, 27 Jan 2013 21:29:47 +0000 (13:29 -0800)
committerMike Verdone <redacted>
Sun, 27 Jan 2013 21:29:47 +0000 (13:29 -0800)
Add forceAnsi option to cmdline.

Enable ansi formatting when stdout isn't a tty. I needed this for use
with geektool.

twitter/cmdline.py
twitter/ircbot.py

index e529d84808eb49f0dee3e9e06919dc9b6e88df8f..f586e4ae8b1eecf554246bf307bb13344ffa1475 100644 (file)
@@ -110,8 +110,8 @@ OPTIONS = {
     'refresh_rate': 600,
     'format': 'default',
     'prompt': '[cyan]twitter[R]> ',
-    'config_filename': os.environ.get('HOME', '') + os.sep + '.twitter',
-    'oauth_filename': os.environ.get('HOME', '') + os.sep + '.twitter_oauth',
+    'config_filename': os.environ.get('HOME', os.environ.get('USERPROFILE', '')) + os.sep + '.twitter',
+    'oauth_filename': os.environ.get('HOME', os.environ.get('USERPROFILE', '')) + os.sep + '.twitter_oauth',
     'length': 20,
     'timestamp': False,
     'datestamp': False,
index 463136fa7c0952870e9f891b1ba93ddb05884943..b41eefd33f9dba6b24d6d2fae50a88382a114741 100644 (file)
@@ -87,7 +87,7 @@ except ImportError:
         "This module requires python irclib available from "
         + "https://github.com/sixohsix/python-irclib/zipball/python-irclib3-0.4.8")
 
-OAUTH_FILE = os.environ.get('HOME', '') + os.sep + '.twitterbot_oauth'
+OAUTH_FILE = os.environ.get('HOME', os.environ.get('USERPROFILE', '')) + os.sep + '.twitterbot_oauth'
 
 def debug(msg):
     # uncomment this for debug text stuff