mirror of
https://github.com/chocolate-doom/statcheck.git
synced 2024-11-10 07:12:09 +00:00
30 lines
681 B
Python
Executable file
30 lines
681 B
Python
Executable file
#!/usr/bin/env python3
|
|
|
|
import os
|
|
from os.path import join
|
|
import shlex
|
|
import sys
|
|
|
|
from common import *
|
|
|
|
source_port = os.getenv("SOURCE_PORT")
|
|
assert source_port != "", "SOURCE_PORT environment variable not set."
|
|
lmp_file, out_file = sys.argv[1:]
|
|
cfg = read_config(lmp_file)
|
|
|
|
args = [
|
|
source_port,
|
|
"-iwad", join("iwads", cfg["iwad"]),
|
|
"-statdump", out_file,
|
|
"-timedemo", lmp_file,
|
|
] + shlex.split(os.getenv("DOOMOPTS", ""))
|
|
|
|
if "gameversion" in cfg:
|
|
args.extend(("-gameversion", cfg["gameversion"]))
|
|
|
|
if "pwad" in cfg:
|
|
args.extend(("-file", join("extract", cfg["pwad"])))
|
|
|
|
command = shlex.join(args) + " >/dev/null 2>&1"
|
|
print(command)
|
|
os.system(command)
|