# 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.
\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
// 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
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()))
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,
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())
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:
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)
import os.path
# Bumped version
-version = '1.2.0'
+version = '1.2.1'
# Require
install_requires = [