mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-10 09:04:36 +00:00
use --file for yad
This commit is contained in:
parent
fc255cf50c
commit
449382d4df
1 changed files with 4 additions and 1 deletions
|
@ -3639,9 +3639,12 @@ def zenity(filetypes=None, initialdir="", initialfile="", **kwargs) -> Tuple[int
|
|||
if sys.platform != "linux":
|
||||
raise Exception("Zenity GUI is only usable on Linux, attempting to use TK GUI.")
|
||||
zenity_bin = shutil.which("yad")
|
||||
using_yad = True
|
||||
if not zenity_bin:
|
||||
zenity_bin = shutil.which("zenity")
|
||||
using_yad = False
|
||||
if not zenity_bin:
|
||||
using_yad = False
|
||||
raise Exception("Zenity not present, falling back to TK GUI.")
|
||||
|
||||
def zenity_clean(txt: str):
|
||||
|
@ -3670,7 +3673,7 @@ def zenity(filetypes=None, initialdir="", initialfile="", **kwargs) -> Tuple[int
|
|||
raise Exception("Zenity not working correctly, falling back to TK GUI.")
|
||||
|
||||
# Build args based on keywords
|
||||
args = ['/usr/bin/env', zenity_bin, '--file-selection']
|
||||
args = ['/usr/bin/env', zenity_bin, ('--file' if using_yad else '--file-selection')]
|
||||
for k, v in kwargs.items():
|
||||
if v is True:
|
||||
args.append(f'--{k.replace("_", "-").strip("-")}')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue