mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-11 01:24:36 +00:00
add debugging info to zenity check
This commit is contained in:
parent
f77574765e
commit
5fa9e02bc3
2 changed files with 4 additions and 2 deletions
|
@ -3650,12 +3650,14 @@ def zenity(filetypes=None, initialdir="", initialfile="", **kwargs) -> Tuple[int
|
||||||
def zenity_sanity_check(): #make sure zenity is sane
|
def zenity_sanity_check(): #make sure zenity is sane
|
||||||
nonlocal zenity_bin
|
nonlocal zenity_bin
|
||||||
try: # Run `zenity --help` and pipe to grep
|
try: # Run `zenity --help` and pipe to grep
|
||||||
result = subprocess.run(f"{zenity_bin} --help | grep Usage", shell=True, capture_output=True, text=True, encoding='utf-8', timeout=10)
|
result = subprocess.run(f"{zenity_bin} --help", shell=True, capture_output=True, text=True, encoding='utf-8', timeout=10)
|
||||||
if result.returncode == 0 and "Usage" in result.stdout:
|
if result.returncode == 0 and "Usage" in result.stdout:
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
|
print(f"Zenity/YAD sanity check failed - ReturnCode={result.returncode}")
|
||||||
return False
|
return False
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
|
print(f"Zenity/YAD sanity check failed - {zenity_bin} not found")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if not zenity_sanity_check():
|
if not zenity_sanity_check():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue