]> git.phdru.name Git - dotfiles.git/commitdiff
init.py: Refactor loop over term types
authorOleg Broytman <phd@phdru.name>
Thu, 29 Mar 2018 18:42:29 +0000 (21:42 +0300)
committerOleg Broytman <phd@phdru.name>
Thu, 29 Mar 2018 18:42:29 +0000 (21:42 +0300)
lib/python/init.py

index ff42ce40c845dbcbd0d94c8dbf4cf96763aeedd5..a6c2388cb9824bbd070e73692dc6d88d17ed55d8 100644 (file)
@@ -77,10 +77,13 @@ def init():
     # From Randall Hopper:
     # https://mail.python.org/pipermail/python-list/2001-March/112696.html
 
+    _term_found = False
     for _term in ['linux', 'rxvt', 'screen', 'term', 'vt100']:
-        if _term not in term:
-            continue
+        if _term in term:
+            _term_found = True
+            break
 
+    if _term_found:
         if background == 'dark':
             ps1_color = '3'  # yellow
             stdout_color = '7'  # bold white
@@ -131,8 +134,6 @@ def init():
             builtin_input = builtins.raw_input
             builtins.raw_input = myinput
 
-        break
-
     try:
         import locale
     except ImportError: