Skip to content

Commit

Permalink
old models at the bottom
Browse files Browse the repository at this point in the history
  • Loading branch information
Sander Land committed Jan 19, 2021
1 parent 92c43ce commit 4c4b9ba
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion katrain/gui/popups.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,11 @@ def find_description(path):
self.paths.append(path) # persistent on paths with models found
model_files += files

model_files = sorted([(find_description(path), path) for path in model_files])
# no description to bottom
model_files = sorted(
[(find_description(path), path) for path in model_files],
key=lambda descpath: "Z" * 10 + path if descpath[0] == descpath[1] else descpath[0],
)
models_available_msg = i18n._("models available").format(num=len(model_files))
self.model_files.values = [models_available_msg] + [desc for desc, path in model_files]
self.model_files.value_keys = [""] + [path for desc, path in model_files]
Expand Down

0 comments on commit 4c4b9ba

Please sign in to comment.