PEP 8 compliance.
This commit is contained in:
parent
ff384678de
commit
e5656378ac
1 changed files with 53 additions and 45 deletions
20
dcc/dsda.py
20
dcc/dsda.py
|
@ -6,6 +6,7 @@ import shutil
|
|||
import subprocess
|
||||
import zipfile
|
||||
|
||||
|
||||
class DSDA(dcc.doom_base.WadMap):
|
||||
def get_parser(self, prog_name):
|
||||
parser = super().get_parser(prog_name)
|
||||
|
@ -20,9 +21,14 @@ class DSDA(dcc.doom_base.WadMap):
|
|||
command = [self.dsda]
|
||||
if shutil.which("xvfb-run") is not None:
|
||||
command = ["xvfb-run"] + command
|
||||
# TODO: negative tics should seek from the end, but this doesn't seem to work.
|
||||
subprocess.run(command + self.dsda_preamble() +
|
||||
["-fastdemo", dip, "-nosound", "-skiptic", "999999999", "-export_text_file"])
|
||||
# TODO: negative tics should seek from the end, but this doesn't
|
||||
# seem to work.
|
||||
subprocess.run(
|
||||
command + self.dsda_preamble() + [
|
||||
"-fastdemo", dip, "-nosound", "-skiptic",
|
||||
"999999999", "-export_text_file"
|
||||
]
|
||||
)
|
||||
editor = "nano"
|
||||
if "EDITOR" in os.environ:
|
||||
editor = os.environ["EDITOR"]
|
||||
|
@ -43,14 +49,16 @@ class DSDA(dcc.doom_base.WadMap):
|
|||
if m is None:
|
||||
continue
|
||||
fh2 = m[1]+m[2]
|
||||
if len(fh2)%2==1:
|
||||
if len(fh2) % 2 == 1:
|
||||
fh2 = "0" + fh2
|
||||
break
|
||||
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.
|
||||
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(dtp, arcname=dtp.name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue