From 819569e8e860ad79245fea5255363f747d7d6070 Mon Sep 17 00:00:00 2001 From: Orakaro Date: Sun, 1 Jun 2014 01:21:59 +0900 Subject: [PATCH] update by comments --- rainbowstream/rainbow.py | 16 +++------------- setup.py | 1 + 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/rainbowstream/rainbow.py b/rainbowstream/rainbow.py index 0bd1123..61bb97b 100644 --- a/rainbowstream/rainbow.py +++ b/rainbowstream/rainbow.py @@ -236,7 +236,6 @@ def switch(): printNicely('') except: printNicely(red('Sorry I can\'t understand.')) - g['prefix'] = False def home(): @@ -276,7 +275,6 @@ def tweet(): """ t = Twitter(auth=authen()) t.statuses.update(status=g['stuff']) - g['prefix'] = False def retweet(): @@ -290,7 +288,6 @@ def retweet(): t.statuses.retweet(id=tid, include_entities=False, trim_user=True) except: printNicely(red('Sorry I can\'t retweet for you.')) - g['prefix'] = False def reply(): @@ -307,7 +304,6 @@ def reply(): t.statuses.update(status=status, in_reply_to_status_id=tid) except: printNicely(red('Sorry I can\'t understand.')) - g['prefix'] = False def delete(): @@ -409,7 +405,6 @@ def clear(): Clear screen """ os.system('clear') - g['prefix'] = False def quit(): @@ -427,7 +422,6 @@ def reset(): """ if g['reset']: printNicely(green('Need tips ? Type "h" and hit Enter key!')) - g['prefix'] = True g['reset'] = False @@ -478,12 +472,9 @@ def listen(): ] )) init_interactive_shell(d) - first = True + reset() while True: - if g['prefix'] and not first: - line = raw_input(g['decorated_name']) - else: - line = raw_input() + line = raw_input(g['decorated_name']) try: cmd = line.split()[0] except: @@ -491,7 +482,6 @@ def listen(): # Save cmd to global variable and call process g['stuff'] = ' '.join(line.split()[1:]) process(cmd)() - first = False def stream(domain, args, name='Rainbow Stream'): @@ -559,7 +549,7 @@ def fly(): p.start() # Start listen process - g['prefix'] = True + time.sleep(0.5) g['reset'] = True g['stream_pid'] = p.pid listen() diff --git a/setup.py b/setup.py index bf81013..2358397 100644 --- a/setup.py +++ b/setup.py @@ -3,6 +3,7 @@ from setuptools import setup, find_packages version = '0.0.1' install_requires = [ + "SQLAlchemy", "colorama", "pyfiglet", "python-dateutil", -- 2.25.1