From f07cfb6b8f5fed1c649d5293cb4c9ea881eca825 Mon Sep 17 00:00:00 2001 From: vunhat_minh Date: Thu, 30 Oct 2014 13:58:07 +0900 Subject: [PATCH] code convention --- README.rst | 6 +++--- docs/conf.py | 4 ++-- docs/index.rst | 6 +++--- rainbowstream/rainbow.py | 34 +++++++++++++++++----------------- rainbowstream/util.py | 8 ++++---- setup.py | 2 +- 6 files changed, 30 insertions(+), 30 deletions(-) diff --git a/README.rst b/README.rst index 8cfe790..d5b45c0 100644 --- a/README.rst +++ b/README.rst @@ -1,10 +1,10 @@ Rainbow Stream -------------- -.. image:: http://img.shields.io/pypi/dm/rainbowstream.svg?style=flat - :target: https://pypi.python.org/pypi/rainbowstream +.. image:: http://img.shields.io/pypi/l/rainbowstream.svg?style=flat-square + :target: https://github.com/DTVD/rainbowstream/blob/master/LICENSE.txt -.. image:: http://img.shields.io/pypi/v/rainbowstream.svg?style=flat +.. image:: http://img.shields.io/pypi/v/rainbowstream.svg?style=flat-square :target: https://pypi.python.org/pypi/rainbowstream Terminal-based Twitter Client. Realtime tweetstream, compose, search , diff --git a/docs/conf.py b/docs/conf.py index 59e330a..303e3f4 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.2.1' +version = '1.2.2' # The full version, including alpha/beta/rc tags. -release = '1.2.1' +release = '1.2.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 297af6f..5ba2701 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,10 +1,10 @@ Rainbow Stream -------------- -.. image:: http://img.shields.io/pypi/dm/rainbowstream.svg?style=flat - :target: https://pypi.python.org/pypi/rainbowstream +.. image:: http://img.shields.io/pypi/l/rainbowstream.svg?style=flat-square + :target: https://github.com/DTVD/rainbowstream/blob/master/LICENSE.txt -.. image:: http://img.shields.io/pypi/v/rainbowstream.svg?style=flat +.. image:: http://img.shields.io/pypi/v/rainbowstream.svg?style=flat-square :target: https://pypi.python.org/pypi/rainbowstream Terminal-based Twitter Client. Realtime tweetstream, compose, search , diff --git a/rainbowstream/rainbow.py b/rainbowstream/rainbow.py index 41b581f..b859bab 100644 --- a/rainbowstream/rainbow.py +++ b/rainbowstream/rainbow.py @@ -99,7 +99,7 @@ def proxy_connect(args): int(args.proxy_port)) else: printNicely( - magenta("Sorry, wrong proxy type specified! Aborting...")) + magenta('Sorry, wrong proxy type specified! Aborting...')) sys.exit() socket.socket = socks.socksocket @@ -115,7 +115,7 @@ def authen(): 'USERPROFILE', '')) + os.sep + '.rainbow_oauth' if not os.path.exists(twitter_credential): - oauth_dance("Rainbow Stream", + oauth_dance('Rainbow Stream', CONSUMER_KEY, CONSUMER_SECRET, twitter_credential) @@ -167,10 +167,10 @@ def upgrade_center(): Check latest and notify to upgrade """ try: - current = pkg_resources.get_distribution("rainbowstream").version + current = pkg_resources.get_distribution('rainbowstream').version url = 'https://raw.githubusercontent.com/DTVD/rainbowstream/master/setup.py' readme = requests.get(url).text - latest = readme.split("version = \'")[1].split("\'")[0] + latest = readme.split('version = \'')[1].split('\'')[0] if current != latest: notice = light_magenta('RainbowStream latest version is ') notice += light_green(latest) @@ -1971,12 +1971,12 @@ def reconn_notice(): """ Notice when Hangup or Timeout """ - guide = light_magenta("You can use ") + \ - light_green("switch") + \ - light_magenta(" command to return to your stream.\n") - guide += light_magenta("Type ") + \ - light_green("h stream") + \ - light_magenta(" for more details.") + guide = light_magenta('You can use ') + \ + light_green('switch') + \ + light_magenta(' command to return to your stream.\n') + guide += light_magenta('Type ') + \ + light_green('h stream') + \ + light_magenta(' for more details.') printNicely(guide) sys.stdout.write(g['decorated_name'](g['PREFIX'])) sys.stdout.flush() @@ -2024,7 +2024,7 @@ def stream(domain, args, name='Rainbow Stream'): last_tweet_time = time.time() for tweet in tweet_iter: if tweet is None: - printNicely("-- None --") + printNicely('-- None --') elif tweet is Timeout: # Because the stream check for each 0.3s # so we shouldn't output anything here @@ -2032,12 +2032,12 @@ def stream(domain, args, name='Rainbow Stream'): StreamLock.release() break elif tweet is HeartbeatTimeout: - printNicely("-- Heartbeat Timeout --") + printNicely('-- Heartbeat Timeout --') reconn_notice() StreamLock.release() break elif tweet is Hangup: - printNicely("-- Hangup --") + printNicely('-- Hangup --') reconn_notice() StreamLock.release() break @@ -2085,7 +2085,7 @@ def stream(domain, args, name='Rainbow Stream'): except TwitterHTTPError as e: printNicely('') printNicely( - magenta("We have connection problem with twitter'stream API right now :(")) + magenta('We have connection problem with twitter stream API right now :(')) detail_twitter_error(e) sys.stdout.write(g['decorated_name'](g['PREFIX'])) sys.stdout.flush() @@ -2104,16 +2104,16 @@ def fly(): except TwitterHTTPError as e: printNicely('') printNicely( - magenta("We have connection problem with twitter'REST API right now :(")) + magenta('We have connection problem with twitter REST API right now :(')) detail_twitter_error(e) save_history() sys.exit() # Proxy connection problem except (socks.ProxyConnectionError, URLError): printNicely( - magenta("There seems to be a connection problem.")) + magenta('There seems to be a connection problem.')) printNicely( - magenta("You might want to check your proxy settings (host, port and type)!")) + magenta('You might want to check your proxy settings (host, port and type)!')) save_history() sys.exit() diff --git a/rainbowstream/util.py b/rainbowstream/util.py index 38c1f42..292a7e5 100644 --- a/rainbowstream/util.py +++ b/rainbowstream/util.py @@ -45,9 +45,9 @@ def format_prefix(listname='', keyword=''): formattedPrefix = ''.join(formattedPrefix.split('#owner')) formattedPrefix = ''.join(formattedPrefix.split('#place')) - formattedPrefix = formattedPrefix.replace("#owner", owner) - formattedPrefix = formattedPrefix.replace("#place", place) - formattedPrefix = formattedPrefix.replace("#keyword", keyword) - formattedPrefix = formattedPrefix.replace("#me", '@' + c['original_name']) + formattedPrefix = formattedPrefix.replace('#owner', owner) + formattedPrefix = formattedPrefix.replace('#place', place) + formattedPrefix = formattedPrefix.replace('#keyword', keyword) + formattedPrefix = formattedPrefix.replace('#me', '@' + c['original_name']) return formattedPrefix diff --git a/setup.py b/setup.py index b9c46ae..f58a816 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ import os import os.path # Bumped version -version = '1.2.1' +version = '1.2.2' # Require install_requires = [ -- 2.25.1