add screenshot
authorOrakaro <nhatminh_179@hotmail.com>
Mon, 5 May 2014 12:46:24 +0000 (21:46 +0900)
committerOrakaro <nhatminh_179@hotmail.com>
Mon, 5 May 2014 12:46:24 +0000 (21:46 +0900)
rainbowstream/config.py
rainbowstream/rainbow.py
screenshot/RainbowStreamv0.0.1.png [new file with mode: 0644]

index cc655e9af40ba0c7ccc756bd2af54462897ce6d4..2ede83b246ef6040dbfa1e471e70a5778d54c057 100644 (file)
@@ -1,2 +1,3 @@
+# This is PTT App info
 CONSUMER_KEY = 'uS6hO2sV6tDKIOeVjhnFnQ'
 CONSUMER_SECRET = 'MEYTOS97VvlHX7K1rwHPEqVpTSqZ71HtvoK4sVuYk'
index b88db9122935f5cbe27d2aa040de4041e9a3e6f3..43fa026999848d1e98c720d5babc2922d6c51644 100644 (file)
@@ -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 (file)
index 0000000..53aad9b
Binary files /dev/null and b/screenshot/RainbowStreamv0.0.1.png differ