mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-10 09:04: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
|
||||
nonlocal zenity_bin
|
||||
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:
|
||||
return True
|
||||
else:
|
||||
print(f"Zenity/YAD sanity check failed - ReturnCode={result.returncode}")
|
||||
return False
|
||||
except FileNotFoundError:
|
||||
print(f"Zenity/YAD sanity check failed - {zenity_bin} not found")
|
||||
return False
|
||||
|
||||
if not zenity_sanity_check():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue