Fix some bugs by pull requests
[rainbowstream.git] / rainbowstream / rainbow.py
index 129ad29743e6183a30049958faba46661e4567ca..3a55c18ab5a6c06e058e021133a26654f292ea37 100644 (file)
@@ -239,11 +239,8 @@ def init(args):
     c['message_dict'] = []
     # Image on term
     c['IMAGE_ON_TERM'] = args.image_on_term
-    set_config('IMAGE_ON_TERM', str(c['IMAGE_ON_TERM']))
     # Use 24 bit color
     c['24BIT'] = args.color_24bit
-    # Resize images based on the current terminal size
-    set_config('IMAGE_RESIZE_TO_FIT', str(c.get('IMAGE_RESIZE_TO_FIT', False)))
     # Check type of ONLY_LIST and IGNORE_LIST
     if not isinstance(c['ONLY_LIST'], list):
         printNicely(red('ONLY_LIST is not a valid list value.'))
@@ -885,7 +882,7 @@ def mute():
             rel = t.mutes.users.create(screen_name=screen_name[1:])
             if isinstance(rel, dict):
                 printNicely(green(screen_name + ' is muted.'))
-                c['IGNORE_LIST'] += [unc(screen_name)]
+                c['IGNORE_LIST'] += [screen_name]
                 c['IGNORE_LIST'] = list(set(c['IGNORE_LIST']))
             else:
                 printNicely(red(rel))
@@ -1979,8 +1976,6 @@ def listen():
                 g['prefix'] = False
             else:
                 g['prefix'] = True
-            # Release the semaphore lock
-            c['lock'] = False
         except EOFError:
             printNicely('')
         except TwitterHTTPError as e:
@@ -1988,6 +1983,9 @@ def listen():
         except Exception:
             debug_option()
             printNicely(red('OMG something is wrong with Twitter API right now.'))
+        finally:
+            # Release the semaphore lock
+            c['lock'] = False
 
 
 def reconn_notice():