diff --git a/katrain/core/engine.py b/katrain/core/engine.py index 19b55d5..6ffb786 100644 --- a/katrain/core/engine.py +++ b/katrain/core/engine.py @@ -37,7 +37,7 @@ class KataGoEngine: self.query_counter = 0 self.katago_process = None self.base_priority = 0 - self.override_settings = {'reportAnalysisWinratesAs':'BLACK'} # mainly for bot scripts to hook into + self.override_settings = {'reportAnalysisWinratesAs':'BLACK'} # force these settings self._lock = threading.Lock() self.analysis_thread = None self.stderr_thread = None diff --git a/katrain/gui/popups.py b/katrain/gui/popups.py index c78e693..d8488e5 100644 --- a/katrain/gui/popups.py +++ b/katrain/gui/popups.py @@ -29,7 +29,6 @@ from katrain.core.utils import find_package_resource, PATHS from katrain.gui.kivyutils import BackgroundMixin, I18NSpinner from katrain.gui.style import DEFAULT_FONT, EVAL_COLORS from katrain.gui.widgets.progress_loader import ProgressLoader -from katrain.gui.widgets.selection_slider import SelectionSlider class I18NPopup(Popup): @@ -336,7 +335,6 @@ class ConfigAIPopup(QuickConfigGui): for _ in range((self.max_options - len(mode_settings)) * 2): self.options_grid.add_widget(Label(size_hint_x=None)) - class ConfigPopup(QuickConfigGui): def __init__(self, katrain): super().__init__(katrain) @@ -353,6 +351,7 @@ class ConfigPopup(QuickConfigGui): path = path.rstrip("/\\") if path.startswith("katrain"): path = path.replace("katrain", PATHS["PACKAGE"].rstrip("/\\"), 1) + path = os.path.expanduser(path) if not os.path.isdir(path): path, _file = os.path.split(path) slashpath = path.replace("\\", "/") @@ -382,8 +381,11 @@ class ConfigPopup(QuickConfigGui): def download_models(self, *_largs): def download_complete(req, tmp_path, path, model): - os.rename(tmp_path, path) - self.katrain.log(f"Download of {model} model complete -> {path}", OUTPUT_INFO) + try: + os.rename(tmp_path, path) + self.katrain.log(f"Download of {model} model complete -> {path}", OUTPUT_INFO) + except Exception as e: + self.katrain.log(f"Download of {model} model complete, but could not move file: {e}", OUTPUT_ERROR) self.check_models() for name, url in self.MODELS.items(): diff --git a/katrain/popups.kv b/katrain/popups.kv index 036a4e4..37c44aa 100644 --- a/katrain/popups.kv +++ b/katrain/popups.kv @@ -123,7 +123,7 @@ Spinner: id: model_files text: '' - on_text: if self.text and self.text != self.values[0]: model_path.text = self.text + on_text: if self.text and self.text != self.values[0]: model_path.text = args[1] size_hint_y: 0.7 sync_height_frac: 1.0 -font_size: self.height * 0.5