diff --git a/couchpotato/environment.py b/couchpotato/environment.py index a4d50747..7fe691e8 100644 --- a/couchpotato/environment.py +++ b/couchpotato/environment.py @@ -1,6 +1,7 @@ from couchpotato.core.event import fireEvent, addEvent from couchpotato.core.loader import Loader from couchpotato.core.settings import Settings +import os class Env(object): @@ -71,3 +72,14 @@ class Env(object): @staticmethod def addEvent(*args, **kwargs): return addEvent(*args, **kwargs) + + @staticmethod + def getPid(): + try: + try: + parent = os.getppid() + except: + parent = None + return '%d %s' % (os.getpid(), '(%d)' % parent if parent else '') + except: + return 0 diff --git a/couchpotato/static/scripts/page/about.js b/couchpotato/static/scripts/page/about.js index 000500be..05e13329 100644 --- a/couchpotato/static/scripts/page/about.js +++ b/couchpotato/static/scripts/page/about.js @@ -56,6 +56,8 @@ var AboutSettingTab = new Class({ } } }), + new Element('dt[text=ID]'), + new Element('dd', {'text': App.getOption('pid')}), new Element('dt[text=Directories]'), new Element('dd', {'text': App.getOption('app_dir')}), new Element('dd', {'text': App.getOption('data_dir')}), diff --git a/couchpotato/templates/_desktop.html b/couchpotato/templates/_desktop.html index acd49b2a..306eeb3c 100644 --- a/couchpotato/templates/_desktop.html +++ b/couchpotato/templates/_desktop.html @@ -88,6 +88,7 @@ 'options': "{{ env.get('options')|safe }}", 'app_dir': {{ env.get('app_dir')|tojson|safe }}, 'data_dir': {{ env.get('data_dir')|tojson|safe }}, + 'pid': {{ env.getPid()|tojson|safe }}, 'userscript_version': {{ fireEvent('userscript.get_version', single = True)|tojson|safe }} }); })