From 05f7e8a9e295b7a8825c2ce9f3eb9de4997e0e1f Mon Sep 17 00:00:00 2001 From: Kuba Marek Date: Sat, 1 Dec 2012 20:45:07 +0100 Subject: [PATCH] Ok, less is more. --- inhibit_shutdown.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/inhibit_shutdown.py b/inhibit_shutdown.py index 6a5ad85..60ec789 100644 --- a/inhibit_shutdown.py +++ b/inhibit_shutdown.py @@ -3,7 +3,6 @@ import xbmc import subprocess -import functools # Set of (protocol, local port) tuples. watched = { @@ -12,7 +11,8 @@ } sleep_time = 60 * 1000 # sleep time between checks in miliseconds -log = functools.partial(print, "service.inhibit_shutdown:") +def log(msg): + print("service.inhibit_shutdown: " + msg) def check_services(): """ Check if any of the watched services is running. """ @@ -34,9 +34,7 @@ def check_services(): while not xbmc.abortRequested: if check_services(): - log("Inhibiting idle shutdown") xbmc.executebuiltin('InhibitIdleShutdown(true)') else: - log("Allowing idle shutdown") xbmc.executebuiltin('InhibitIdleShutdown(false)') xbmc.sleep(sleep_time)