Partially fixed Unity bug (frames display but menu doesnt)
This commit is contained in:
parent
886ce2b6d6
commit
f655adbf90
|
|
@ -6,6 +6,9 @@
|
||||||
import svlgui
|
import svlgui
|
||||||
from threading import Event, Thread
|
from threading import Event, Thread
|
||||||
import math
|
import math
|
||||||
|
import subprocess
|
||||||
|
import re
|
||||||
|
import os
|
||||||
|
|
||||||
def select_any(self):
|
def select_any(self):
|
||||||
svlgui.MODE = " "
|
svlgui.MODE = " "
|
||||||
|
|
@ -66,6 +69,21 @@ def box(x, y, width, height, fill):
|
||||||
return box
|
return box
|
||||||
|
|
||||||
|
|
||||||
|
def process_exists(proc_name):
|
||||||
|
ps = subprocess.Popen("ps ax -o pid= -o args= ", shell=True, stdout=subprocess.PIPE)
|
||||||
|
ps_pid = ps.pid
|
||||||
|
output = ps.stdout.read()
|
||||||
|
ps.stdout.close()
|
||||||
|
ps.wait()
|
||||||
|
|
||||||
|
for line in output.split("\n"):
|
||||||
|
res = re.findall("(\d+) (.*)", line)
|
||||||
|
if res:
|
||||||
|
pid = int(res[0][0])
|
||||||
|
if proc_name in res[0][1] and pid != os.getpid() and pid != ps_pid:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def lastval(arr,index):
|
def lastval(arr,index):
|
||||||
for i in reversed(arr[:index]):
|
for i in reversed(arr[:index]):
|
||||||
if i:
|
if i:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue