code convention
authorvunhat_minh <vunhat_minh@dwango.co.jp>
Thu, 30 Oct 2014 04:58:07 +0000 (13:58 +0900)
committervunhat_minh <vunhat_minh@dwango.co.jp>
Thu, 30 Oct 2014 04:58:07 +0000 (13:58 +0900)
README.rst
docs/conf.py
docs/index.rst
rainbowstream/rainbow.py
rainbowstream/util.py
setup.py

index 8cfe79058783239e2d0316e11a8896692a1003f5..d5b45c0cc6290ee0cacee2c6d8619d1e72fd136a 100644 (file)
@@ -1,10 +1,10 @@
 Rainbow Stream\r
 --------------\r
 \r
 Rainbow Stream\r
 --------------\r
 \r
-.. image:: http://img.shields.io/pypi/dm/rainbowstream.svg?style=flat\r
-   :target: https://pypi.python.org/pypi/rainbowstream\r
+.. image:: http://img.shields.io/pypi/l/rainbowstream.svg?style=flat-square\r
+   :target: https://github.com/DTVD/rainbowstream/blob/master/LICENSE.txt\r
 \r
 \r
-.. image:: http://img.shields.io/pypi/v/rainbowstream.svg?style=flat\r
+.. image:: http://img.shields.io/pypi/v/rainbowstream.svg?style=flat-square\r
    :target: https://pypi.python.org/pypi/rainbowstream\r
 \r
 Terminal-based Twitter Client. Realtime tweetstream, compose, search ,\r
    :target: https://pypi.python.org/pypi/rainbowstream\r
 \r
 Terminal-based Twitter Client. Realtime tweetstream, compose, search ,\r
index 59e330ad741c7cdab8e8293b0ede3bd6e0078f70..303e3f472ce6dca729aa188df5f352513594cd92 100644 (file)
@@ -48,9 +48,9 @@ copyright = u'2014, Vu Nhat Minh'
 # built documents.
 #
 # The short X.Y version.
 # built documents.
 #
 # The short X.Y version.
-version = '1.2.1'
+version = '1.2.2'
 # The full version, including alpha/beta/rc tags.
 # 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.
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
index 297af6fb5a1405cef17cbedf6df64139fa9db288..5ba27014a8e8829ac9fcb74658d58108b243ae1a 100644 (file)
@@ -1,10 +1,10 @@
 Rainbow Stream\r
 --------------\r
 \r
 Rainbow Stream\r
 --------------\r
 \r
-.. image:: http://img.shields.io/pypi/dm/rainbowstream.svg?style=flat\r
-   :target: https://pypi.python.org/pypi/rainbowstream\r
+.. image:: http://img.shields.io/pypi/l/rainbowstream.svg?style=flat-square\r
+   :target: https://github.com/DTVD/rainbowstream/blob/master/LICENSE.txt\r
 \r
 \r
-.. image:: http://img.shields.io/pypi/v/rainbowstream.svg?style=flat\r
+.. image:: http://img.shields.io/pypi/v/rainbowstream.svg?style=flat-square\r
    :target: https://pypi.python.org/pypi/rainbowstream\r
 \r
 Terminal-based Twitter Client. Realtime tweetstream, compose, search ,\r
    :target: https://pypi.python.org/pypi/rainbowstream\r
 \r
 Terminal-based Twitter Client. Realtime tweetstream, compose, search ,\r
index 41b581ff2d68cc5f9d2bbc8464e79df93b7ae6d0..b859bab832bbe13276a794c321470b416957756d 100644 (file)
@@ -99,7 +99,7 @@ def proxy_connect(args):
                 int(args.proxy_port))
         else:
             printNicely(
                 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
 
             sys.exit()
         socket.socket = socks.socksocket
 
@@ -115,7 +115,7 @@ def authen():
             'USERPROFILE',
             '')) + os.sep + '.rainbow_oauth'
     if not os.path.exists(twitter_credential):
             '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)
                     CONSUMER_KEY,
                     CONSUMER_SECRET,
                     twitter_credential)
@@ -167,10 +167,10 @@ def upgrade_center():
     Check latest and notify to upgrade
     """
     try:
     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
         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)
         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
     """
     """
     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()
     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:
         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
             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:
                     StreamLock.release()
                     break
             elif tweet is HeartbeatTimeout:
-                printNicely("-- Heartbeat Timeout --")
+                printNicely('-- Heartbeat Timeout --')
                 reconn_notice()
                 StreamLock.release()
                 break
             elif tweet is Hangup:
                 reconn_notice()
                 StreamLock.release()
                 break
             elif tweet is Hangup:
-                printNicely("-- Hangup --")
+                printNicely('-- Hangup --')
                 reconn_notice()
                 StreamLock.release()
                 break
                 reconn_notice()
                 StreamLock.release()
                 break
@@ -2085,7 +2085,7 @@ def stream(domain, args, name='Rainbow Stream'):
     except TwitterHTTPError as e:
         printNicely('')
         printNicely(
     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()
         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(
     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(
         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(
         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()
 
         save_history()
         sys.exit()
 
index 38c1f4232a8ce6efae6faec18392462812c5857a..292a7e5b408687f88f1f134500032302f011b810 100644 (file)
@@ -45,9 +45,9 @@ def format_prefix(listname='', keyword=''):
         formattedPrefix = ''.join(formattedPrefix.split('#owner'))
         formattedPrefix = ''.join(formattedPrefix.split('#place'))
 
         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
 
     return formattedPrefix
index b9c46ae289d495e0121c1651f79f0ac963963f03..f58a8165a74c190fd0494cd794d52492d83d261b 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@ import os
 import os.path
 
 # Bumped version
 import os.path
 
 # Bumped version
-version = '1.2.1'
+version = '1.2.2'
 
 # Require
 install_requires = [
 
 # Require
 install_requires = [