From: Orakaro Date: Mon, 5 May 2014 12:46:24 +0000 (+0900) Subject: add screenshot X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=06773ffe10d269c9a6d3763faa77a1a10063e0b6;p=rainbowstream.git add screenshot --- diff --git a/rainbowstream/config.py b/rainbowstream/config.py index cc655e9..2ede83b 100644 --- a/rainbowstream/config.py +++ b/rainbowstream/config.py @@ -1,2 +1,3 @@ +# This is PTT App info CONSUMER_KEY = 'uS6hO2sV6tDKIOeVjhnFnQ' CONSUMER_SECRET = 'MEYTOS97VvlHX7K1rwHPEqVpTSqZ71HtvoK4sVuYk' diff --git a/rainbowstream/rainbow.py b/rainbowstream/rainbow.py index b88db91..43fa026 100644 --- a/rainbowstream/rainbow.py +++ b/rainbowstream/rainbow.py @@ -43,22 +43,21 @@ def draw(t): user = green(name) + ' ' + yellow('@' + screen_name) + ' ' clock = magenta('['+ time + ']') tweet = white(text) - userlen = len(name + screen_name) + 3 - clocklen = len(time) + 2 # Draw rainbow terminalrows, terminalcolumns = os.popen('stty size', 'r').read().split() - line1 = u"{u:>{uw}} {t:>{tw}}".format( + line1 = u"{u:>{uw}}:".format( u = user, uw = len(user) + 2, - t = clock, - tw = len(clock) + int(terminalcolumns) - userlen - 4 - clocklen ) + line2 = u"{c:>{cw}}".format( + c = clock, + cw = len(clock) + 2, + ) + line3 = ' ' + tweet + line4 = '\n' - line2 = ' ' + tweet - line3 = '\n' - - return line1, line2, line3 + return line1, line2, line3, line4 def parse_arguments(): @@ -112,10 +111,11 @@ def main(): elif tweet is Hangup: printNicely("-- Hangup --") elif tweet.get('text'): - line1, line2, line3 = draw(t = tweet) + line1, line2, line3, line4 = draw(t = tweet) printNicely(line1) printNicely(line2) printNicely(line3) + printNicely(line4) if __name__ == '__main__': main() diff --git a/screenshot/RainbowStreamv0.0.1.png b/screenshot/RainbowStreamv0.0.1.png new file mode 100644 index 0000000..53aad9b Binary files /dev/null and b/screenshot/RainbowStreamv0.0.1.png differ