From: Orakaro Date: Fri, 26 Sep 2014 13:47:58 +0000 (+0900) Subject: fix bug with ONLY_LIST and IGNORE_LIST X-Git-Url: https://vcs.fsf.org/?p=rainbowstream.git;a=commitdiff_plain;h=d4b36355938733b0f2d3434057716a1b917a96d1 fix bug with ONLY_LIST and IGNORE_LIST --- diff --git a/docs/conf.py b/docs/conf.py index b008c55..87dc7c5 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -48,9 +48,9 @@ copyright = u'2014, Vu Nhat Minh' # built documents. # # The short X.Y version. -version = '1.1.1' +version = '1.1.2' # The full version, including alpha/beta/rc tags. -release = '1.1.1' +release = '1.1.2' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/index.rst b/docs/index.rst index 0e9dfea..b9dcdb4 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -220,9 +220,7 @@ Here is full list of supported command: ``Ignore nicks``\ decide what nicks will be exclude. -- ``switch public #AKB48 -d`` will apply filter to *ONLY\_LIST* and *IGNORE\_LIST*. You can setup 2 list above at ``config.py`` - -- ``switch mine`` will switch current stream to personal stream. ``-f`` and ``-d`` will work as well. +- ``switch mine`` will switch current stream to personal stream. ``-f`` will work as well. - ``switch list`` will switch to a Twitter list's stream. You will be asked for list name. @@ -339,9 +337,9 @@ You also can view or set a new value of every config key by ``config`` command ( - ``LIST_MAX``: default tweets to display on 'list home' command. -- ``ONLY_LIST``: filter list on 'switch' command. +- ``ONLY_LIST``: filter list on 'switch' command. Eg: ["@fat","mdo"] -- ``IGNORE_LIST``: ignore list on 'switch' command. +- ``IGNORE_LIST``: ignore list on 'switch' command. Eg: ["@fat"] - ``HISTORY_FILENAME``: name of file which stores input history. diff --git a/rainbowstream/rainbow.py b/rainbowstream/rainbow.py index c18fe15..742c4e9 100644 --- a/rainbowstream/rainbow.py +++ b/rainbowstream/rainbow.py @@ -183,6 +183,13 @@ def init(args): # Image on term c['IMAGE_ON_TERM'] = args.image_on_term set_config('IMAGE_ON_TERM', str(c['IMAGE_ON_TERM'])) + # Check type of ONLY_LIST and IGNORE_LIST + if not isinstance(c['ONLY_LIST'], list): + printNicely(red('ONLY_LIST is not a valid list value.')) + c['ONLY_LIST'] = [] + if not isinstance(c['IGNORE_LIST'], list): + printNicely(red('IGNORE_LIST is not a valid list value.')) + c['IGNORE_LIST'] = [] # Mute dict c['IGNORE_LIST'] += build_mute_dict() @@ -1177,9 +1184,6 @@ def switch(): ignore = raw_input('Ignore nicks [Ex: @xxx,@yy]: ') args.filter = filter(None, only.split(',')) args.ignore = filter(None, ignore.split(',')) - elif g['stuff'].split()[-1] == '-d': - args.filter = c['ONLY_LIST'] - args.ignore = c['IGNORE_LIST'] except: printNicely(red('Sorry, wrong format.')) return @@ -1536,8 +1540,6 @@ def help_stream(): ' filter will decide nicks will be INCLUDE ONLY.\n' usage += s * 3 + light_yellow('Ignore nicks') + \ ' filter will decide nicks will be EXCLUDE.\n' - usage += s * 2 + light_green('switch mine -d') + \ - ' will use the config\'s ONLY_LIST and IGNORE_LIST.\n' usage += s * 2 + light_green('switch list') + \ ' will switch to a Twitter list\'s stream. You will be asked for list name\n' printNicely(usage) diff --git a/setup.py b/setup.py index b930f62..aeedcd7 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ import os import os.path # Bumped version -version = '1.1.1' +version = '1.1.2' # Require install_requires = [