Show pid and parent_id in about page
This commit is contained in:
1 parent
84246a6799
commit
80ecfdba00
3 files changed
+15
No files matched your search
@@ -1,6 +1,7 @@
|
|||||||
from couchpotato.core.event import fireEvent, addEvent
|
from couchpotato.core.event import fireEvent, addEvent
|
||||||
from couchpotato.core.loader import Loader
|
from couchpotato.core.loader import Loader
|
||||||
from couchpotato.core.settings import Settings
|
from couchpotato.core.settings import Settings
|
||||||
|
import os
|
||||||
|
|
||||||
class Env(object):
|
class Env(object):
|
||||||
|
|
||||||
@@ -71,3 +72,14 @@ class Env(object):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def addEvent(*args, **kwargs):
|
def addEvent(*args, **kwargs):
|
||||||
return 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
|
||||||
@@ -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('dt[text=Directories]'),
|
||||||
new Element('dd', {'text': App.getOption('app_dir')}),
|
new Element('dd', {'text': App.getOption('app_dir')}),
|
||||||
new Element('dd', {'text': App.getOption('data_dir')}),
|
new Element('dd', {'text': App.getOption('data_dir')}),
|
||||||
|
|||||||
@@ -88,6 +88,7 @@
|
|||||||
'options': "{{ env.get('options')|safe }}",
|
'options': "{{ env.get('options')|safe }}",
|
||||||
'app_dir': {{ env.get('app_dir')|tojson|safe }},
|
'app_dir': {{ env.get('app_dir')|tojson|safe }},
|
||||||
'data_dir': {{ env.get('data_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 }}
|
'userscript_version': {{ fireEvent('userscript.get_version', single = True)|tojson|safe }}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in new issue
Block a user