compile all user starting points
This commit is contained in:
parent
6ffaad0afe
commit
8ea3f34898
|
@ -85,7 +85,14 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
player_names = list(file[:-5] for file in player_files)
|
player_names = list(file[:-5] for file in player_files)
|
||||||
|
|
||||||
command = f"py -{py_version} Mystery.py --multi {len(player_files)} {player_string} " \
|
if os.path.exists("BerserkerMultiServer.exe"):
|
||||||
|
basemysterycommand = "BerserkerMystery.exe" #compiled windows
|
||||||
|
elif os.path.exists("BerserkerMultiServer"):
|
||||||
|
basemysterycommand = "BerserkerMystery" # compiled linux
|
||||||
|
else:
|
||||||
|
basemysterycommand = f"py -{py_version} Mystery.py" #source
|
||||||
|
|
||||||
|
command = f"{basemysterycommand} --multi {len(player_files)} {player_string} " \
|
||||||
f"--names {','.join(player_names)} --enemizercli {enemizer_location} " \
|
f"--names {','.join(player_names)} --enemizercli {enemizer_location} " \
|
||||||
f"--outputpath {outputpath}" + " --create_spoiler" if create_spoiler else "" + " --race" if race else ""
|
f"--outputpath {outputpath}" + " --create_spoiler" if create_spoiler else "" + " --race" if race else ""
|
||||||
print(command)
|
print(command)
|
||||||
|
@ -128,7 +135,15 @@ if __name__ == "__main__":
|
||||||
os.remove(file)
|
os.remove(file)
|
||||||
print(f"Removed file {file} that is now present in the zipfile")
|
print(f"Removed file {file} that is now present in the zipfile")
|
||||||
|
|
||||||
subprocess.call(f"py -{py_version} MultiServer.py --multidata {os.path.join(outputpath, multidataname)}")
|
if os.path.exists("BerserkerMultiServer.exe"):
|
||||||
|
baseservercommand = "BerserkerMultiServer.exe" # compiled windows
|
||||||
|
elif os.path.exists("BerserkerMultiServer"):
|
||||||
|
baseservercommand = "BerserkerMultiServer" # compiled linux
|
||||||
|
else:
|
||||||
|
baseservercommand = f"py -{py_version} MultiServer.py" # source
|
||||||
|
#don't have a mac to test that. If you try to run compiled on mac, good luck.
|
||||||
|
|
||||||
|
subprocess.call(f"{baseservercommand} --multidata {os.path.join(outputpath, multidataname)}")
|
||||||
except:
|
except:
|
||||||
import traceback
|
import traceback
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
|
8
Utils.py
8
Utils.py
|
@ -36,13 +36,15 @@ def local_path(path):
|
||||||
if local_path.cached_path is not None:
|
if local_path.cached_path is not None:
|
||||||
return os.path.join(local_path.cached_path, path)
|
return os.path.join(local_path.cached_path, path)
|
||||||
|
|
||||||
if is_bundled():
|
if is_bundled() and hasattr(sys, "_MEIPASS"):
|
||||||
# we are running in a bundle
|
# we are running in a PyInstaller bundle
|
||||||
local_path.cached_path = sys._MEIPASS # pylint: disable=protected-access,no-member
|
local_path.cached_path = sys._MEIPASS # pylint: disable=protected-access,no-member
|
||||||
|
elif is_bundled():
|
||||||
|
#probably cxFreeze
|
||||||
|
local_path.cached_path = os.path.dirname(sys.argv[0])
|
||||||
else:
|
else:
|
||||||
# we are running in a normal Python environment
|
# we are running in a normal Python environment
|
||||||
local_path.cached_path = os.path.dirname(os.path.abspath(__file__))
|
local_path.cached_path = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
||||||
return os.path.join(local_path.cached_path, path)
|
return os.path.join(local_path.cached_path, path)
|
||||||
|
|
||||||
local_path.cached_path = None
|
local_path.cached_path = None
|
||||||
|
|
19
setup.py
19
setup.py
|
@ -43,9 +43,18 @@ def manifest_creation():
|
||||||
json.dump(manifest, open(manifestpath, "wt"), indent=4)
|
json.dump(manifest, open(manifestpath, "wt"), indent=4)
|
||||||
print("Created Manifest")
|
print("Created Manifest")
|
||||||
|
|
||||||
EXE = cx_Freeze.Executable(
|
scripts = {"MultiClient.py" : "BerserkerMultiClient",
|
||||||
script="MultiClient.py",
|
"MultiMystery.py" : "BerserkerMultiMystery",
|
||||||
targetName="BerserkerMultiClient" if sys.platform == "linux" else "BerserkerMultiClient.exe"
|
"MultiServer.py" : "BerserkerMultiServer",
|
||||||
|
"gui.py" : "BerserkerMultiCreator",
|
||||||
|
"Mystery.py" : "BerserkerMystery"}
|
||||||
|
|
||||||
|
exes = []
|
||||||
|
|
||||||
|
for script, scriptname in scripts.items():
|
||||||
|
exes.append(cx_Freeze.Executable(
|
||||||
|
script=script,
|
||||||
|
targetName=scriptname + ("" if sys.platform == "linux" else ".exe"))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -57,7 +66,7 @@ cx_Freeze.setup(
|
||||||
name="HonorarPlus",
|
name="HonorarPlus",
|
||||||
version=f"{buildtime.year}.{buildtime.month}.{buildtime.day}.{buildtime.hour}",
|
version=f"{buildtime.year}.{buildtime.month}.{buildtime.day}.{buildtime.hour}",
|
||||||
description="HonorarPlus",
|
description="HonorarPlus",
|
||||||
executables=[EXE],
|
executables=exes,
|
||||||
options={
|
options={
|
||||||
"build_exe": {
|
"build_exe": {
|
||||||
"zip_include_packages": ["*"],
|
"zip_include_packages": ["*"],
|
||||||
|
@ -87,7 +96,7 @@ def installfile(path):
|
||||||
print('Warning,', path, 'not found')
|
print('Warning,', path, 'not found')
|
||||||
|
|
||||||
|
|
||||||
extra_data = ["LICENSE"]
|
extra_data = ["LICENSE", "data", "EnemizerCLI"]
|
||||||
|
|
||||||
for data in extra_data:
|
for data in extra_data:
|
||||||
installfile(Path(data))
|
installfile(Path(data))
|
||||||
|
|
Loading…
Reference in New Issue