From b71f1d8d8029edeb4954798b7a00c38f741d83ad Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sun, 15 Sep 2019 13:33:59 -0700 Subject: [PATCH] Reordered functions --- scripts/wk/std.py | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/scripts/wk/std.py b/scripts/wk/std.py index e51b14e2..fd20a286 100644 --- a/scripts/wk/std.py +++ b/scripts/wk/std.py @@ -125,7 +125,7 @@ class Menu(): """Format display name based on details and args, returns str.""" disabled = details.get('Disabled', False) checkmark = '*' - if 'DISPLAY' in os.environ or sys.platform == 'darwin': + if 'DISPLAY' in os.environ or platform.system() == 'Darwin': checkmark = '✓' clear_code = COLORS['CLEAR'] color_code = COLORS['YELLOW'] if disabled else '' @@ -672,24 +672,6 @@ def clear_screen(): subprocess.run(cmd, check=False, shell=True, stderr=subprocess.PIPE) -def get_log_filepath(): - """Get the log filepath from the root logger, returns pathlib.Path obj. - - NOTE: This will use the first handler baseFilename it finds (if any). - """ - log_filepath = None - root_logger = logging.getLogger() - - # Check handlers - for handler in root_logger.handlers: - if hasattr(handler, 'baseFilename'): - log_filepath = pathlib.Path(handler.baseFilename).resolve() - break - - # Done - return log_filepath - - def generate_debug_report(): """Generate debug report, returns str.""" import socket @@ -734,6 +716,24 @@ def generate_debug_report(): return '\n'.join(report) +def get_log_filepath(): + """Get the log filepath from the root logger, returns pathlib.Path obj. + + NOTE: This will use the first handler baseFilename it finds (if any). + """ + log_filepath = None + root_logger = logging.getLogger() + + # Check handlers + for handler in root_logger.handlers: + if hasattr(handler, 'baseFilename'): + log_filepath = pathlib.Path(handler.baseFilename).resolve() + break + + # Done + return log_filepath + + def input_text(prompt='Enter text'): """Get text from user, returns string.""" prompt = str(prompt)