From 764cf6e62e6054f81e7b0b30294d8f6a82ed3efa Mon Sep 17 00:00:00 2001 From: Nils Vogels Date: Thu, 29 May 2014 03:17:43 +0200 Subject: [PATCH] Change process title for more clarity when running multiple python progs --- SickBeard.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/SickBeard.py b/SickBeard.py index b6cc16b3..e5a36cc7 100755 --- a/SickBeard.py +++ b/SickBeard.py @@ -180,6 +180,16 @@ def main(): # Need console logging for SickBeard.py and SickBeard-console.exe consoleLogging = (not hasattr(sys, "frozen")) or (sickbeard.MY_NAME.lower().find('-console') > 0) + # Attempt to rename the process for easier debugging + try: + from setproctitle import setproctitle + except ImportError: + if consoleLogging: + sys.stderr.write(u"setproctitle module is not available.\n") + setproctitle = lambda t: None + + setproctitle(sickbeard.MY_NAME) + # Rename the main thread threading.currentThread().name = "MAIN"