diff --git a/LICENSE b/LICENSE index 0d8b8aa..c972dd9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,10 +1,11 @@ This repository includes: -1. Binaries for 'KataGo', which is Copyright 2019 David J Wu et al. +1. Binaries for 'KataGo', which is Copyright David J Wu et al. For on related licenses for these binaries and libraries see https://github.com/lightvector/KataGo 2. Icons from www.flaticon.com, used with permission with the following attributions: - Equalize icon and Thrash Icon: derived from work by bqlqn from www.flaticon.com +- Local search icon: derived from work by Pixel Perfect from www.flaticon.com - Other Menu icons and Flag icons: derived from work by Freepik from www.flaticon.com 3. The True Type Font DIGITAL-7 version 1.02 by Sizenko Alexander, which is free for non-commercial use. diff --git a/katrain/core/base_katrain.py b/katrain/core/base_katrain.py index e8604a8..819a30c 100644 --- a/katrain/core/base_katrain.py +++ b/katrain/core/base_katrain.py @@ -49,13 +49,13 @@ class KaTrainBase: """Settings, logging, and players functionality, so other classes like bots who need a katrain instance can be used without a GUI""" - def __init__(self, force_package_config=False, debug_level=0, **kwargs): - self.debug_level = debug_level + def __init__(self, force_package_config=False, debug_level=None, **kwargs): + self.debug_level = debug_level or 0 self.game = None self.logger = lambda message, level=OUTPUT_INFO: self.log(message, level) self.config_file = self._load_config(force_package_config=force_package_config) - self.debug_level = debug_level or self.config("general/debug_level", OUTPUT_INFO) + self.debug_level = self.config("general/debug_level", OUTPUT_INFO) if debug_level is None else debug_level Config.set("kivy", "log_level", "warning") if self.debug_level >= OUTPUT_DEBUG: diff --git a/katrain/core/engine.py b/katrain/core/engine.py index 17ce22b..914ad34 100644 --- a/katrain/core/engine.py +++ b/katrain/core/engine.py @@ -134,11 +134,14 @@ class KataGoEngine: raise EngineDiedException(died_msg) return ok + def wait_to_finish(self): + while self.queries and self.katago_process and self.katago_process.poll() is None: + time.sleep(0.1) + def shutdown(self, finish=False): process = self.katago_process if finish and process: - while self.queries and process.poll() is None: - time.sleep(0.1) + self.wait_to_finish() if process: self.katago_process = None process.terminate() diff --git a/katrain/gui/badukpan.py b/katrain/gui/badukpan.py index 05e987e..387928b 100644 --- a/katrain/gui/badukpan.py +++ b/katrain/gui/badukpan.py @@ -469,7 +469,7 @@ class BadukPanWidget(Widget): source="img/topmove.png", ) if self.trainer_config["text_point_loss"] and text_on: - if move_dict["pointsLost"] < 0.05: + if -0.05 < move_dict["pointsLost"] < 0.05: ptloss_text = "0.0" else: ptloss_text = f"{-move_dict['pointsLost']:+.1f}" diff --git a/katrain/img/local.png b/katrain/img/local.png index 3bae846..cc4506a 100644 Binary files a/katrain/img/local.png and b/katrain/img/local.png differ