print adapt to screen size
authorvunhat_minh <vunhat_minh@dwango.co.jp>
Mon, 26 May 2014 02:41:41 +0000 (11:41 +0900)
committervunhat_minh <vunhat_minh@dwango.co.jp>
Mon, 26 May 2014 02:41:41 +0000 (11:41 +0900)
rainbowstream/rainbow.py

index 9461d22679a274e70a61a35e571d0f91ecd6ee11..00621d0fba9b4ac78202ba27ce52fd0aaa7feeca 100644 (file)
@@ -136,11 +136,13 @@ def search():
     """
     t = Twitter(auth=authen())
     rel = t.search.tweets(q='#' + g['stuff'])['statuses']
-    printNicely(grey('**************************************************************************************\n'))
+    h, w = os.popen('stty size', 'r').read().split()
+
+    printNicely(grey('*'*int(w)+'\n'))
     print('Newest',SEARCH_MAX_RECORD, 'tweet: \n')
     for i in xrange(5):
         draw(t=rel[i],keyword=g['stuff'].strip())
-    printNicely(grey('**************************************************************************************\n'))
+    printNicely(grey('*'*int(w)+'\n'))
 
 
 def friend():