3.11: runwatch
This commit is contained in:
parent
7dfac95f1e
commit
8abc7dd8e8
@ -28,10 +28,16 @@ class RunWatch(IntervalModule):
|
|||||||
return os.path.exists("/proc/{pid}/".format(pid=pid))
|
return os.path.exists("/proc/{pid}/".format(pid=pid))
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
alive = False
|
||||||
|
pid = 0
|
||||||
|
try:
|
||||||
with open(glob.glob(self.path)[0], "r") as f:
|
with open(glob.glob(self.path)[0], "r") as f:
|
||||||
pid = int(f.read().strip())
|
pid = int(f.read().strip())
|
||||||
|
alive = self.is_process_alive(pid)
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
if self.is_process_alive(pid):
|
if alive:
|
||||||
fmt = self.format_up
|
fmt = self.format_up
|
||||||
color = self.color_up
|
color = self.color_up
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user