sgf arg fix
This commit is contained in:
1 parent
eab4997bf4
commit
135e16188d
1 file changed
+7
-2
+7
-2
@@ -157,8 +157,13 @@ class KaTrainGui(Screen, KaTrainBase):
|
||||
self.board_gui.trainer_config = self.config("trainer")
|
||||
self.engine = KataGoEngine(self, self.config("engine"))
|
||||
threading.Thread(target=self._message_loop_thread, daemon=True).start()
|
||||
if len(sys.argv) == 2 and os.path.isfile(sys.argv[1]) and not sys.argv[1].endswith('json'):
|
||||
self.load_sgf_file(sys.argv[1], fast=True, rewind=True)
|
||||
sgf_args = [
|
||||
f
|
||||
for f in sys.argv[1:]
|
||||
if os.path.isfile(f) and any(f.lower().endswith(ext) for ext in ["sgf", "ngf", "gib"])
|
||||
]
|
||||
if sgf_args:
|
||||
self.load_sgf_file(sgf_args[0], fast=True, rewind=True)
|
||||
else:
|
||||
self._do_new_game()
|
||||
|
||||
|
||||
Reference in new issue
Block a user