mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-09-18 16:55:14 +02:00
zentk - folder select workaround (#1478)
* zentk - folder select workaround * kcppt extention fix
This commit is contained in:
+5
-1
@@ -3528,7 +3528,11 @@ def zenity(typ, filetypes=None, initialdir="", initialfile="", **kwargs) -> Tupl
|
||||
|
||||
def zentk_askopenfilename(**options):
|
||||
try:
|
||||
from os.path import isfile
|
||||
result = zenity('file-selection', filetypes=options.get("filetypes"), initialdir=options.get("initialdir"), title=options.get("title"))[1]
|
||||
if result and not isfile(result):
|
||||
print("A folder was selected while we need a file, ignoring selection.")
|
||||
return ''
|
||||
except:
|
||||
from tkinter.filedialog import askopenfilename
|
||||
result = askopenfilename(**options)
|
||||
@@ -4420,7 +4424,7 @@ def show_gui():
|
||||
return
|
||||
filenamestr = str(filename).strip()
|
||||
if not filenamestr.endswith(".kcppt"):
|
||||
filenamestr += ".kcpps"
|
||||
filenamestr += ".kcppt"
|
||||
file = open(filenamestr, 'w')
|
||||
file.write(json.dumps(savdict))
|
||||
file.close()
|
||||
|
||||
Reference in New Issue
Block a user