From 6e84fadabc86c8f12d6e4d6f435c58e5e8c2d6d0 Mon Sep 17 00:00:00 2001 From: aristocratos Date: Sun, 23 Aug 2020 14:59:38 +0200 Subject: [PATCH] Fix init screen and error log level when starting from pip installation --- bpytop.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/bpytop.py b/bpytop.py index 32d7220..29c9b17 100755 --- a/bpytop.py +++ b/bpytop.py @@ -474,9 +474,7 @@ class Config: try: CONFIG: Config = Config(CONFIG_FILE) - if not __name__ == "__main__": - errlog.setLevel(logging.ERROR) - elif DEBUG: + if DEBUG: errlog.setLevel(logging.DEBUG) else: errlog.setLevel(getattr(logging, CONFIG.log_level)) @@ -509,9 +507,6 @@ class Term: """Terminal info and commands""" width: int = 0 height: int = 0 - if __name__ == "__main__": - width = os.get_terminal_size().columns - height = os.get_terminal_size().lines resized: bool = False _w : int = 0 _h : int = 0 @@ -4408,6 +4403,9 @@ THEME: Theme def main(): global THEME + Term.width = os.get_terminal_size().columns + Term.height = os.get_terminal_size().lines + #? Init --------------------------------------------------------------------------------------> if DEBUG: TimeIt.start("Init")