removed useless condition where .exe was added to the tools_path if it was a windows system

This commit is contained in:
Faraphel 2022-07-15 16:41:42 +02:00
parent 5aeb864ef7
commit db9d32a450
6 changed files with 36 additions and 5 deletions

View file

@ -1,6 +1,6 @@
from source.wt import * from source.wt import *
tools_path = tools_szs_dir / ("wbmgt.exe" if system == "win64" else "wbmgt") tools_path = tools_szs_dir / "wbmgt"
_tools_run = get_tools_run_function(tools_path) _tools_run = get_tools_run_function(tools_path)

View file

@ -1,6 +1,6 @@
from source.wt import * from source.wt import *
tools_path = tools_szs_dir / ("wimgt.exe" if system == "win64" else "wimgt") tools_path = tools_szs_dir / "wimgt"
_tools_run = get_tools_run_function(tools_path) _tools_run = get_tools_run_function(tools_path)

31
source/wt/lec.py Normal file
View file

@ -0,0 +1,31 @@
from source.wt import *
tools_path = tools_szs_dir / "wlect"
_tools_run = get_tools_run_function(tools_path)
_tools_run_popen = get_tools_run_popen_function(tools_path)
def patch_data(lecode_data: bytes, game_tracks_directory: Path | str,
copy_tracks_directory: Path | str, move_tracks_directory: Path | str,
ct_file: Path | str, lpar: Path | str) -> bytes:
"""
Patch a LECODE.bin file content
:param lpar: parameter that can be applied to the lecode configuration
:param ct_file: file defining track and arena slots
:param move_tracks_directory: tracks to move inside the game
:param copy_tracks_directory: tracks to copy inside the game
:param game_tracks_directory: directory to all the game tracks
:param lecode_data: LECODE.bin file content
:return: patched LECODE.bin file content
"""
args = []
# TODO: implement args
process = _tools_run_popen("PATCH", "-", "--DEST", "-", *args)
stdout, _ = process.communicate(input=lecode_data)
if process.returncode != 0:
raise WTError(tools_path, process.returncode)
return stdout

View file

@ -1,7 +1,7 @@
from source.wt import * from source.wt import *
from source.wt import _run, _run_dict from source.wt import _run, _run_dict
tools_path = tools_szs_dir / ("wszst.exe" if system == "win64" else "wszst") tools_path = tools_szs_dir / "wszst"
_tools_run = get_tools_run_function(tools_path) _tools_run = get_tools_run_function(tools_path)

View file

@ -5,7 +5,7 @@ from typing import Generator
from source.wt import * from source.wt import *
tools_path = tools_wit_dir / ("wit.exe" if system == "win64" else "wit") tools_path = tools_wit_dir / "wit"
_tools_run = get_tools_run_function(tools_path) _tools_run = get_tools_run_function(tools_path)

View file

@ -1,6 +1,6 @@
from source.wt import * from source.wt import *
tools_path = tools_szs_dir / ("wstrt.exe" if system == "win64" else "wstrt") tools_path = tools_szs_dir / "wstrt"
_tools_run = get_tools_run_function(tools_path) _tools_run = get_tools_run_function(tools_path)