abspath / load fix
This commit is contained in:
1 parent
5fc3ce2dc0
commit
f63f960e1a
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -240,7 +240,7 @@ class Game:
|
|||||||
black = re.sub(r"['<>:\"/\\|?*]", "", black or "Black")
|
black = re.sub(r"['<>:\"/\\|?*]", "", black or "Black")
|
||||||
white = re.sub(r"['<>:\"/\\|?*]", "", white or "White")
|
white = re.sub(r"['<>:\"/\\|?*]", "", white or "White")
|
||||||
game_name = f"katrain_{black} vs {white} {self.game_id}"
|
game_name = f"katrain_{black} vs {white} {self.game_id}"
|
||||||
file_name = os.path.join(path, f"{game_name}.sgf")
|
file_name = os.path.abspath(os.path.join(path, f"{game_name}.sgf"))
|
||||||
os.makedirs(os.path.dirname(file_name), exist_ok=True)
|
os.makedirs(os.path.dirname(file_name), exist_ok=True)
|
||||||
|
|
||||||
show_dots_for = {p: trainer_config.get("eval_show_ai", True) or "ai" not in self.katrain.controls.player_mode(p) for p in Move.PLAYERS}
|
show_dots_for = {p: trainer_config.get("eval_show_ai", True) or "ai" not in self.katrain.controls.player_mode(p) for p in Move.PLAYERS}
|
||||||
|
|||||||
+1
-1
@@ -187,7 +187,7 @@ class KaTrainGui(BoxLayout):
|
|||||||
self.fileselect_popup = Popup(title="Double Click SGF file to analyze", size_hint=(0.8, 0.8)).__self__
|
self.fileselect_popup = Popup(title="Double Click SGF file to analyze", size_hint=(0.8, 0.8)).__self__
|
||||||
popup_contents = LoadSGFPopup()
|
popup_contents = LoadSGFPopup()
|
||||||
self.fileselect_popup.add_widget(popup_contents)
|
self.fileselect_popup.add_widget(popup_contents)
|
||||||
popup_contents.filesel.path = os.path.expanduser(self.config("sgf/sgf_load"))
|
popup_contents.filesel.path = os.path.abspath(os.path.expanduser(self.config("sgf/sgf_load")))
|
||||||
|
|
||||||
def readfile(files, _mouse):
|
def readfile(files, _mouse):
|
||||||
self.fileselect_popup.dismiss()
|
self.fileselect_popup.dismiss()
|
||||||
|
|||||||
Reference in new issue
Block a user