1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-11-10 19:35:08 -05:00

Change process title for more clarity when running multiple python progs

This commit is contained in:
Nils Vogels 2014-05-29 03:17:43 +02:00
parent 690b904b98
commit 764cf6e62e

View File

@ -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"