From c5026270e27982b6404717064d64b6d044022255 Mon Sep 17 00:00:00 2001 From: Dag Wieers Date: Wed, 30 Oct 2019 01:05:36 +0100 Subject: [PATCH] Small improvements --- resources/settings.xml | 2 +- screensaver.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/settings.xml b/resources/settings.xml index e688dd6..9764fef 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -28,6 +28,6 @@ - + diff --git a/screensaver.py b/screensaver.py index f57a396..8036ef4 100644 --- a/screensaver.py +++ b/screensaver.py @@ -101,7 +101,7 @@ def to_unicode(text, encoding='utf-8'): def log(level=1, msg='', **kwargs): ''' Log info messages to Kodi ''' max_log_level = int(get_setting('max_log_level', 0)) - if not DEBUG_LOGGING and not (level <= max_log_level or max_log_level == 0): + if not DEBUG_LOGGING and not (level <= max_log_level and max_log_level != 0): return from string import Formatter if kwargs: @@ -175,7 +175,7 @@ def run_command(*command, **kwargs): ''' Run commands on the OS while catching exceptions ''' # TODO: Add options for running using su or sudo try: - cmd = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **kwargs) + cmd = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=False, **kwargs) (out, err) = cmd.communicate() if cmd.returncode == 0: log(2, msg="Running command '{command}' returned rc={rc}", command=' '.join(command), rc=cmd.returncode) @@ -271,7 +271,7 @@ def exit(self): del self.monitor self.close() - del self +# del self class TurnOffMonitor(Monitor, object):