fix bug of unicode prefix character
authorvunhat_minh <vunhat_minh@dwango.co.jp>
Fri, 29 Aug 2014 03:13:26 +0000 (12:13 +0900)
committervunhat_minh <vunhat_minh@dwango.co.jp>
Fri, 29 Aug 2014 03:13:26 +0000 (12:13 +0900)
docs/conf.py
rainbowstream/rainbow.py
setup.py

index ade949af826412a03cccb78cce33b1d50a8f2f03..e2755a4ba205d915112ded95b43f4f3e078e172d 100644 (file)
@@ -48,9 +48,9 @@ copyright = u'2014, Vu Nhat Minh'
 # built documents.
 #
 # The short X.Y version.
-version = '0.9.1'
+version = '0.9.2'
 # The full version, including alpha/beta/rc tags.
-release = '0.9.1'
+release = '0.9.2'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
index de908e6ae94dfc997b8b1ef73c93b23a47106bf2..c939747bf1a11a9ce3996ffcb9467f7e2cbeb2b9 100644 (file)
@@ -122,6 +122,7 @@ def init(args):
     name = credential['name']
     if not get_config('PREFIX'):
         set_config('PREFIX', screen_name)
+    g['PREFIX'] = u2str(c['PREFIX'])
     c['original_name'] = g['original_name'] = screen_name[1:]
     g['full_name'] = name
     g['decorated_name'] = lambda x: color_func(
@@ -1700,7 +1701,7 @@ def listen():
         try:
             # raw_input
             if g['prefix']:
-                line = raw_input(g['decorated_name'](c['PREFIX']))
+                line = raw_input(g['decorated_name'](g['PREFIX']))
             else:
                 line = raw_input()
             # Save cmd to compare with readline buffer
@@ -1727,7 +1728,7 @@ def listen():
             printNicely('')
         except Exception:
             printNicely(red('OMG something is wrong with Twitter right now.'))
-
+            break
 
 def stream(domain, args, name='Rainbow Stream'):
     """
@@ -1784,7 +1785,7 @@ def stream(domain, args, name='Rainbow Stream'):
                     light_green("h stream") + \
                     light_magenta(" for more details.")
                 printNicely(guide)
-                sys.stdout.write(g['decorated_name'](c['PREFIX']))
+                sys.stdout.write(g['decorated_name'](g['PREFIX']))
                 sys.stdout.flush()
                 StreamLock.release()
                 break
@@ -1812,10 +1813,10 @@ def stream(domain, args, name='Rainbow Stream'):
                 # the 1st character of that word
                 if current_buffer and g['cmd'] != current_buffer:
                     sys.stdout.write(
-                        g['decorated_name'](c['PREFIX']) + str2u(current_buffer))
+                        g['decorated_name'](g['PREFIX']) + str2u(current_buffer))
                     sys.stdout.flush()
                 elif not c['HIDE_PROMPT']:
-                    sys.stdout.write(g['decorated_name'](c['PREFIX']))
+                    sys.stdout.write(g['decorated_name'](g['PREFIX']))
                     sys.stdout.flush()
             elif tweet.get('direct_message'):
                 # Check the semaphore pause and lock (stream process only)
index 6337cfeb2c4a29e911fa231cd75a7e6e9a220206..34088f6d52cec650d22b0d729f3bf6ba59d24798 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@ import os
 import os.path
 
 # Bumped version
-version = '0.9.1'
+version = '0.9.2'
 
 # Require
 install_requires = [