mirror of
https://github.com/9001/copyparty.git
synced 2025-08-16 16:42:13 -06:00
slightly better pyinstaller loader
This commit is contained in:
parent
95566e8388
commit
7c1d97af3b
|
@ -106,20 +106,19 @@ def meichk():
|
||||||
if filt not in sys.executable:
|
if filt not in sys.executable:
|
||||||
filt = os.path.basename(sys.executable)
|
filt = os.path.basename(sys.executable)
|
||||||
|
|
||||||
pids = []
|
hits = []
|
||||||
ptn = re.compile(r"^([^\s]+)\s+([0-9]+)")
|
|
||||||
try:
|
try:
|
||||||
procs = sp.check_output("tasklist").decode("utf-8", "replace")
|
cmd = "tasklist /fo csv".split(" ")
|
||||||
|
procs = sp.check_output(cmd).decode("utf-8", "replace")
|
||||||
except:
|
except:
|
||||||
procs = "" # winpe
|
procs = "" # winpe
|
||||||
|
|
||||||
for ln in procs.splitlines():
|
for ln in procs.split("\n"):
|
||||||
m = ptn.match(ln)
|
if filt in ln.split('"')[:2][-1]:
|
||||||
if m and filt in m.group(1).lower():
|
hits.append(ln)
|
||||||
pids.append(int(m.group(2)))
|
|
||||||
|
|
||||||
mod = os.path.dirname(os.path.realpath(__file__))
|
mod = os.path.dirname(os.path.realpath(__file__))
|
||||||
if os.path.basename(mod).startswith("_MEI") and len(pids) == 2:
|
if os.path.basename(mod).startswith("_MEI") and len(hits) == 2:
|
||||||
meicln(mod)
|
meicln(mod)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue