PEP 8 compliance.

This commit is contained in:
yrriban 2025-06-15 01:11:01 -04:00
parent ff384678de
commit e5656378ac

View file

@ -6,6 +6,7 @@ import shutil
import subprocess import subprocess
import zipfile import zipfile
class DSDA(dcc.doom_base.WadMap): class DSDA(dcc.doom_base.WadMap):
def get_parser(self, prog_name): def get_parser(self, prog_name):
parser = super().get_parser(prog_name) parser = super().get_parser(prog_name)
@ -20,9 +21,14 @@ class DSDA(dcc.doom_base.WadMap):
command = [self.dsda] command = [self.dsda]
if shutil.which("xvfb-run") is not None: if shutil.which("xvfb-run") is not None:
command = ["xvfb-run"] + command command = ["xvfb-run"] + command
# TODO: negative tics should seek from the end, but this doesn't seem to work. # TODO: negative tics should seek from the end, but this doesn't
subprocess.run(command + self.dsda_preamble() + # seem to work.
["-fastdemo", dip, "-nosound", "-skiptic", "999999999", "-export_text_file"]) subprocess.run(
command + self.dsda_preamble() + [
"-fastdemo", dip, "-nosound", "-skiptic",
"999999999", "-export_text_file"
]
)
editor = "nano" editor = "nano"
if "EDITOR" in os.environ: if "EDITOR" in os.environ:
editor = os.environ["EDITOR"] editor = os.environ["EDITOR"]
@ -47,10 +53,12 @@ class DSDA(dcc.doom_base.WadMap):
fh2 = "0" + fh2 fh2 = "0" + fh2
break break
if not fh2: if not fh2:
sys.exit("Failed to match any line in {} against Time regex.".format(dtp)) sys.exit(f"Failed to match any line in {dtp} against Time regex.")
# TODO: demo names other than uv-max. # TODO: demo names other than uv-max.
fnf = fh1 + "-" + fh2 + ".zip" fnf = fh1 + "-" + fh2 + ".zip"
with zipfile.ZipFile(self.demos.joinpath(self.wad).joinpath(fnf), mode="w") as zf: with zipfile.ZipFile(
self.demos.joinpath(self.wad).joinpath(fnf), mode="w"
) as zf:
zf.write(dip, arcname=dip.name) zf.write(dip, arcname=dip.name)
zf.write(dtp, arcname=dtp.name) zf.write(dtp, arcname=dtp.name)