Skip to content

Commit

Permalink
0.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
latorc committed Apr 15, 2024
1 parent 4920c19 commit d76cb40
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions bot/bot_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,21 @@ def __init__(self, model_files:dict[GameMode, str]) -> None:
self._supported_modes: list[GameMode] = list(model_files.keys())
self.model_files = model_files
for k,v in model_files.items():
mode_valid:bool = True
if not Path(v).exists() or not Path(v).is_file():
# test file exists
LOGGER.warning("Cannot find model file for mode %s:%s", k,v)
self._supported_modes.remove(k)
if k == GameMode.MJ3P:
mode_valid = False
elif k == GameMode.MJ3P:
# test import libraries for 3p
try:
import libriichi3p
except Exception as e: # pylint: disable=bare-except
LOGGER.warning("Cannot import libriichi3p: %s", e)
self._supported_modes.remove(k)
mode_valid = False
if not mode_valid:
self._supported_modes.remove(k)

if not self._supported_modes:
raise ModelFileException("No valid model files found")

Expand Down
Empty file.
2 changes: 1 addition & 1 deletion scripts/generate_exe.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ REM robocopy . .\dist\MahjongCopilot settings.json
REM robocopy models dist\MahjongCopilot\models /E
robocopy resources dist\MahjongCopilot\resources /E
robocopy liqi_proto dist\MahjongCopilot\liqi_proto /E
REM robocopy .\libriichi3p\ dist\MahjongCopilot\_internal\libriichi3p\ *.pyd *.so /E
robocopy .\libriichi3p\ dist\MahjongCopilot\_internal\libriichi3p\ "Put libriichi3p files in this folder"
robocopy .venv\Lib\site-packages\playwright\driver\package\.local-browsers dist\MahjongCopilot\_internal\playwright\driver\package\.local-browsers /E
explorer.exe dist
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.0
0.5.1

0 comments on commit d76cb40

Please sign in to comment.