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 03182df62ff0a06cd339ff206c354dfb5e820719..59e330ad741c7cdab8e8293b0ede3bd6e0078f70 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 9dd732e337696fdf94a99b57ed38a1d4b26dae90..297af6fb5a1405cef17cbedf6df64139fa9db288 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 31e6294ad757bb49c691d5b7df7c331054547520..bae4eb77c02b265f7e17ff2cd0040337cf6fb9be 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 fe144015df00367a566d8e0a1b5cc0abf4cd23b2..41b581ff2d68cc5f9d2bbc8464e79df93b7ae6d0 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 8a33711ceb7efc98a954a48e4337e02b848bd474..38c1f4232a8ce6efae6faec18392462812c5857a 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 ed0362c7151abe5c2192578cd21359fb83da58bb..b9c46ae289d495e0121c1651f79f0ac963963f03 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 = [