Show pid and parent_id in about page

This commit is contained in:
Ruud committed 2012-03-05 19:02:53 +01:00
1 parent 84246a6799
commit 80ecfdba00
3 files changed
+15

No files matched your search

+12
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