Show pid and parent_id in about page

This commit is contained in:
Ruud
2012-03-05 19:02:53 +01:00
parent 84246a6799
commit 80ecfdba00
3 changed files with 15 additions and 0 deletions

View File

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

View File

@@ -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')}),

View File

@@ -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 }}
});
})