Partially fixed Unity bug (frames display but menu doesnt)

This commit is contained in:
Skyler Lehmkuhl 2012-01-24 16:58:49 -05:00
parent 886ce2b6d6
commit f655adbf90
1 changed files with 18 additions and 0 deletions

View File

@ -6,6 +6,9 @@
import svlgui
from threading import Event, Thread
import math
import subprocess
import re
import os
def select_any(self):
svlgui.MODE = " "
@ -66,6 +69,21 @@ def box(x, y, width, height, fill):
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):
for i in reversed(arr[:index]):
if i: