check search result size and show min(len(result), count).
authory_benjo <ybenjo.repose@gmail.com>
Tue, 29 May 2018 23:18:53 +0000 (08:18 +0900)
committery_benjo <ybenjo.repose@gmail.com>
Tue, 29 May 2018 23:18:53 +0000 (08:18 +0900)
rainbowstream/rainbow.py

index aded31d..2056c32 100644 (file)
@@ -454,7 +454,7 @@ def search():
     # Return results
     if rel:
         printNicely('Newest tweets:')
-        for i in reversed(xrange(count)):
+        for i in reversed(xrange(min(len(rel), count))):
             draw(t=rel[i], keyword=query)
         printNicely('')
     else: