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
-.. 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
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
-.. 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
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
'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)
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)
"""
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()
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
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
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()
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()
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