bumped version
authorvunhat_minh <vunhat_minh@dwango.co.jp>
Thu, 30 Oct 2014 04:38:50 +0000 (13:38 +0900)
committervunhat_minh <vunhat_minh@dwango.co.jp>
Thu, 30 Oct 2014 04:38:50 +0000 (13:38 +0900)
docs/conf.py
docs/index.rst
rainbowstream/colorset/config
rainbowstream/rainbow.py
rainbowstream/util.py
setup.py

index 03182df..59e330a 100644 (file)
@@ -48,9 +48,9 @@ copyright = u'2014, Vu Nhat Minh'
 # built documents.
 #
 # The short X.Y version.
-version = '1.2.0'
+version = '1.2.1'
 # The full version, including alpha/beta/rc tags.
-release = '1.2.0'
+release = '1.2.1'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
index 9dd732e..297af6f 100644 (file)
@@ -325,10 +325,10 @@ You also can view or set a new value of every config key by ``config`` command (
 \r
 -  ``PREFIX``: display formated string of prompt.\r
 \r
-    + ``#me``: Your username with '@'\r
-    + ``#place``: Current list name or public for public stream\r
-    + ``#owner``: Owner of the current list\r
-    + ``#keyword``: Keyword for a public stream\r
+    + ``#me``: Your username with '@', only available in personal stream.\r
+    + ``#place``: List name, only available in list stream.\r
+    + ``#owner``: Owner of list name, only available in list stream.\r
+    + ``#keyword``: Keyword, only available on public stream.\r
 \r
 -  ``SEARCH_TYPE``: search type in 'search' command ('mixed','recent','popular').\r
 \r
index 31e6294..bae4eb7 100644 (file)
@@ -10,7 +10,7 @@
     // Hide promt when receive a tweet
     "HIDE_PROMPT" : true,
     // Prefix
-    "PREFIX" : "",
+    "PREFIX" : "#owner#place#me#keyword",
     // 'search': search type ('mixed','recent','popular')
     "SEARCH_TYPE" : "mixed",
     // 'search': search max result, number over 100 will fallback to 100
index fe14401..41b581f 100644 (file)
@@ -202,8 +202,6 @@ def init(args):
     credential = t.account.verify_credentials()
     screen_name = '@' + credential['screen_name']
     name = credential['name']
-    if not get_config('PREFIX'):
-        set_config('PREFIX', screen_name)
     c['original_name'] = g['original_name'] = screen_name[1:]
     g['listname'] = g['keyword'] = ''
     g['PREFIX'] = u2str(emojize(format_prefix()))
@@ -1248,7 +1246,7 @@ def switch():
             g['keyword'] = keyword
             g['listname'] = ''
             # Reset prefix
-            g['PREFIX'] = u2str(emojize(format_prefix(keyword = g['keyword'])))
+            g['PREFIX'] = u2str(emojize(format_prefix(keyword=g['keyword'])))
             # Start new thread
             th = threading.Thread(
                 target=stream,
@@ -1279,11 +1277,13 @@ def switch():
             owner, slug = get_slug()
             # Force python 2 not redraw readline buffer
             listname = '/'.join([owner, slug])
-            # Set the listname variable 
+            # Set the listname variable
             # and reset tracked keyword
             g['listname'] = listname
             g['keyword'] = ''
-            g['PREFIX'] = g['cmd'] = u2str(emojize(format_prefix(listname = g['listname'])))
+            g['PREFIX'] = g['cmd'] = u2str(emojize(format_prefix(
+                listname=g['listname']
+            )))
             printNicely(light_yellow('getting list members ...'))
             # Get members
             t = Twitter(auth=authen())
@@ -1420,7 +1420,10 @@ def config():
                 g['decorated_name'] = lambda x: color_func(
                     c['DECORATED_NAME'])('[' + x + ']: ')
             elif key == 'PREFIX':
-                g['PREFIX'] = u2str(emojize(format_prefix(listname = g['listname'], keyword = g['keyword'])))
+                g['PREFIX'] = u2str(emojize(format_prefix(
+                    listname=g['listname'],
+                    keyword=g['keyword']
+                )))
             reload_config()
             printNicely(green('Updated successfully.'))
         except:
index 8a33711..38c1f42 100644 (file)
@@ -21,20 +21,29 @@ def detail_twitter_error(twitterException):
         printNicely(yellow(info))
 
 
-def format_prefix(listname = '', keyword = ''):
+def format_prefix(listname='', keyword=''):
     """
     Format the custom prefix
     """
     formattedPrefix = c['PREFIX']
     owner = '@' + c['original_name']
     place = ''
+    # Public stream
     if keyword:
-        place = '/public'
-        keyword = '#' + keyword
-
-    if listname:
+        formattedPrefix = ''.join(formattedPrefix.split('#owner'))
+        formattedPrefix = ''.join(formattedPrefix.split('#place'))
+        formattedPrefix = ''.join(formattedPrefix.split('#me'))
+    # List stream
+    elif listname:
+        formattedPrefix = ''.join(formattedPrefix.split('#keyword'))
+        formattedPrefix = ''.join(formattedPrefix.split('#me'))
         owner, place = listname.split('/')
-        place = "/" + place
+        place = '/' + place
+    # Personal stream
+    else:
+        formattedPrefix = ''.join(formattedPrefix.split('#keyword'))
+        formattedPrefix = ''.join(formattedPrefix.split('#owner'))
+        formattedPrefix = ''.join(formattedPrefix.split('#place'))
 
     formattedPrefix = formattedPrefix.replace("#owner", owner)
     formattedPrefix = formattedPrefix.replace("#place", place)
index ed0362c..b9c46ae 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@ import os
 import os.path
 
 # Bumped version
-version = '1.2.0'
+version = '1.2.1'
 
 # Require
 install_requires = [