add support for python 3
[rainbowstream.git] / rainbowstream / rainbow.py
index 584d8e2c68cfefaf0fa3810e2d7f9449e7ef5281..af674eb3d6b91a4c2d8ec35fe8306c0d081c92b6 100644 (file)
@@ -17,7 +17,6 @@ from twitter.api import *
 from twitter.oauth import OAuth, read_token_file
 from twitter.oauth_dance import oauth_dance
 from twitter.util import printNicely
-from StringIO import StringIO
 
 from .draw import *
 from .colors import *
@@ -26,6 +25,8 @@ from .consumer import *
 from .interactive import *
 from .db import *
 from .c_image import *
+from .py3patch import *
+
 
 g = {}
 db = RainbowDB()
@@ -329,7 +330,10 @@ def quote():
     text = tweet['text']
     quote = '\"@' + screen_name + ': ' + text + '\"'
     quote = quote.encode('utf8')
-    printNicely(light_magenta('Compose mode:'))
+    notice = light_magenta('Compose mode ')
+    notice += light_yellow('(Enter nothing will cancel the quote)')
+    notice += light_magenta(':')
+    printNicely(notice)
     extra = raw_input(quote)
     if extra:
         t.statuses.update(status=quote+extra)
@@ -834,6 +838,7 @@ def theme():
         f = open(path,'w')
         f.write(c['theme'])
         f.close()
+        os.system('chmod 777 ' + path)
         printNicely(light_green('Okay it will be applied from next time :)'))
     else:
         # Change theme
@@ -945,7 +950,7 @@ def help():
 
     # Follower and following
     usage += '\n'
-    usage += s + grey(u'\u266A' + ' Fiends and followers \n')
+    usage += s + grey(u'\u266A' + ' Friends and followers \n')
     usage += s * 2 + \
         light_green('ls fl') + \
         ' will list all followers (people who are following you).\n'
@@ -1147,8 +1152,7 @@ def listen():
         try:
             g['stuff'] = ' '.join(line.split()[1:])
             process(cmd)()
-        except Exception,e :
-            print e
+        except Exception:
             printNicely(red('OMG something is wrong with Twitter right now.'))
         # Not redisplay prefix
         if cmd in ['switch', 't', 'rt', 'rep']: