Fix blank line
[rainbowstream.git] / rainbowstream / rainbow.py
index ad7534a..a7007cc 100644 (file)
@@ -251,7 +251,7 @@ def init(args):
     g['PREFIX'] = u2str(emojize(format_prefix()))
     g['full_name'] = name
     g['decorated_name'] = lambda x: color_func(
-        c['DECORATED_NAME'])('[' + x + ']: ')
+        c['DECORATED_NAME'])('[' + x + ']: ', rl=True)
     # Theme init
     files = os.listdir(os.path.dirname(__file__) + '/colorset')
     themes = [f.split('.')[0] for f in files if f.split('.')[-1] == 'json']
@@ -341,7 +341,8 @@ def poll():
         g['since_id'] = result[0]['id']
     for tweet in reversed(result):
         draw(t=tweet)
-    printNicely('')
+    if result:
+        printNicely('')
 
 def home():
     """
@@ -838,8 +839,8 @@ def inbox():
     # Get inbox messages
     messages = t.direct_messages.events.list()['events']
     messages = list(map(map_message, messages))
-    inbox = filter(inboxFilter, messages)
-    sent = filter(inboxFilter, messages)
+    inbox = list(filter(inboxFilter, messages))
+    sent = list(filter(sentFilter, messages))
 
     d = {}
     uniq_inbox = list(set(
@@ -1493,7 +1494,7 @@ def theme():
             # Redefine decorated_name
             g['decorated_name'] = lambda x: color_func(
                 c['DECORATED_NAME'])(
-                '[' + x + ']: ')
+                '[' + x + ']: ', rl=True)
             printNicely(green('Theme changed.'))
         except:
             printNicely(red('No such theme exists.'))
@@ -1556,7 +1557,7 @@ def config():
             if key == 'THEME':
                 c['THEME'] = reload_theme(value, c['THEME'])
                 g['decorated_name'] = lambda x: color_func(
-                    c['DECORATED_NAME'])('[' + x + ']: ')
+                    c['DECORATED_NAME'])('[' + x + ']: ', rl=True)
             elif key == 'PREFIX':
                 g['PREFIX'] = u2str(emojize(format_prefix(
                     listname=g['listname'],