Compare commits
No commits in common. "d585c1529d6f645a895d8d5025e3e815d7c4ee25" and "21bdcf3e1777213e2c52493ae70d85567f780c69" have entirely different histories.
d585c1529d
...
21bdcf3e17
7 changed files with 25 additions and 23 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
import dcc.doom_base
|
import dcc.doom_base
|
||||||
import dcc.config
|
import dcc.config
|
||||||
import os
|
import subprocess
|
||||||
|
|
||||||
|
|
||||||
class Eureka(dcc.doom_base.WadMap):
|
class Eureka(dcc.doom_base.WadMap):
|
||||||
|
|
@ -24,7 +24,7 @@ class Eureka(dcc.doom_base.WadMap):
|
||||||
if complevel == "11" or complevel == "21":
|
if complevel == "11" or complevel == "21":
|
||||||
port = "mbf"
|
port = "mbf"
|
||||||
|
|
||||||
os.execvp("eureka",
|
subprocess.run(
|
||||||
["eureka"] + ["-iwad", iwad] + ["-w", parsed_args.map]
|
["eureka"] + ["-iwad", iwad] + ["-w", parsed_args.map]
|
||||||
+ ["-p", port] + [mw]
|
+ ["-p", port] + [mw]
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import contextlib
|
import contextlib
|
||||||
import dcc.config
|
import dcc.config
|
||||||
import dcc.doom_base
|
import dcc.doom_base
|
||||||
import os
|
|
||||||
import shutil
|
import shutil
|
||||||
|
import subprocess
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -18,7 +18,7 @@ class Fabricate(dcc.doom_base.WadMap):
|
||||||
command = [self.dsda]
|
command = [self.dsda]
|
||||||
if not parsed_args.fg and shutil.which("xvfb-run") is not None:
|
if not parsed_args.fg and shutil.which("xvfb-run") is not None:
|
||||||
command = ["xvfb-run"] + command
|
command = ["xvfb-run"] + command
|
||||||
os.execvp(command[0],
|
subprocess.run(
|
||||||
command + self.dsda_preamble()
|
command + self.dsda_preamble()
|
||||||
+ ["-timedemo", self.demo_in_path()]
|
+ ["-timedemo", self.demo_in_path()]
|
||||||
+ ["-viddump", self.video_path()]
|
+ ["-viddump", self.video_path()]
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import dcc.config
|
import dcc.config
|
||||||
import dcc.doom_base
|
import dcc.doom_base
|
||||||
import os
|
import subprocess
|
||||||
|
|
||||||
|
|
||||||
class PB(dcc.doom_base.WadMap):
|
class PB(dcc.doom_base.WadMap):
|
||||||
def take_action(self, parsed_args):
|
def take_action(self, parsed_args):
|
||||||
os.execvp("ffplay", ["ffplay", self.video_path()])
|
subprocess.run(["ffplay", self.video_path()])
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import dcc.config
|
import dcc.config
|
||||||
import dcc.doom_base
|
import dcc.doom_base
|
||||||
import os
|
import subprocess
|
||||||
|
|
||||||
|
|
||||||
class Play(dcc.doom_base.WadMap):
|
class Play(dcc.doom_base.WadMap):
|
||||||
def take_action(self, parsed_args):
|
def take_action(self, parsed_args):
|
||||||
os.execv(self.dsda, [self.dsda] + self.dsda_preamble())
|
subprocess.run([self.dsda] + self.dsda_preamble())
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
import dcc.config
|
import dcc.config
|
||||||
import dcc.doom_base
|
import dcc.doom_base
|
||||||
import os
|
import subprocess
|
||||||
|
|
||||||
|
|
||||||
class Record(dcc.doom_base.WadMap):
|
class Record(dcc.doom_base.WadMap):
|
||||||
def take_action(self, parsed_args):
|
def take_action(self, parsed_args):
|
||||||
os.execv(self.dsda,
|
subprocess.run(
|
||||||
[self.dsda] + self.dsda_preamble() +
|
[self.dsda] + self.dsda_preamble() +
|
||||||
["-record", self.demo_out_path()]
|
["-record", self.demo_out_path()]
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import dcc.doom_base
|
import dcc.doom_base
|
||||||
import pathlib
|
import pathlib
|
||||||
import os
|
import os
|
||||||
|
import subprocess
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -41,7 +42,7 @@ class RIB(dcc.doom_base.WadMap):
|
||||||
+ f"and map {parsed_args.map} (tried to look in {demodir})"
|
+ f"and map {parsed_args.map} (tried to look in {demodir})"
|
||||||
)
|
)
|
||||||
|
|
||||||
os.execv(self.dsda,
|
subprocess.run(
|
||||||
[self.dsda] + self.dsda_preamble(warp=False)
|
[self.dsda] + self.dsda_preamble(warp=False)
|
||||||
+ ["-playdemo", demo]
|
+ ["-playdemo", demo]
|
||||||
+ ["-skiptic", str(-35 * parsed_args.secs_before)]
|
+ ["-skiptic", str(-35 * parsed_args.secs_before)]
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
import cliff.app
|
import cliff.app
|
||||||
import dcc.play
|
import dcc.play
|
||||||
import logging
|
import logging
|
||||||
import os
|
|
||||||
import mockito.matchers
|
import mockito.matchers
|
||||||
import pathlib
|
import pathlib
|
||||||
|
import subprocess
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def test_play(expect):
|
def test_play(when):
|
||||||
with tempfile.TemporaryDirectory() as td:
|
with tempfile.TemporaryDirectory() as td:
|
||||||
tdp = pathlib.Path(td)
|
tdp = pathlib.Path(td)
|
||||||
tdp.joinpath("config.toml").write_text(
|
tdp.joinpath("config.toml").write_text(
|
||||||
|
|
@ -26,14 +26,9 @@ def test_play(expect):
|
||||||
scp.mkdir()
|
scp.mkdir()
|
||||||
scp.joinpath("config.toml").touch()
|
scp.joinpath("config.toml").touch()
|
||||||
scp.joinpath("scythe.wad").touch()
|
scp.joinpath("scythe.wad").touch()
|
||||||
dcc.play.Play.__init__ = lambda self: None
|
zero = subprocess.CompletedProcess
|
||||||
dcc.play.Play.get_epilog = lambda self: ""
|
zero.returncode = 0
|
||||||
rig = dcc.play.Play()
|
when(subprocess).run(
|
||||||
rig._hooks = []
|
|
||||||
parser = rig.get_parser("test_play")
|
|
||||||
parsed_args = parser.parse_args(args=["--doom", td, "scythe", "01"])
|
|
||||||
with expect(os, times=1).execv(
|
|
||||||
tdp.joinpath("dsda-doom").joinpath("exe"),
|
|
||||||
[
|
[
|
||||||
tdp.joinpath("dsda-doom").joinpath("exe"),
|
tdp.joinpath("dsda-doom").joinpath("exe"),
|
||||||
"-iwad",
|
"-iwad",
|
||||||
|
|
@ -47,5 +42,11 @@ def test_play(expect):
|
||||||
"-warp",
|
"-warp",
|
||||||
"01",
|
"01",
|
||||||
]
|
]
|
||||||
).thenReturn(None):
|
).thenReturn(zero)
|
||||||
assert rig.run(parsed_args) is None
|
dcc.play.Play.__init__ = lambda self: None
|
||||||
|
dcc.play.Play.get_epilog = lambda self: ""
|
||||||
|
rig = dcc.play.Play()
|
||||||
|
rig._hooks = []
|
||||||
|
parser = rig.get_parser("test_play")
|
||||||
|
parsed_args = parser.parse_args(args=["--doom", td, "scythe", "01"])
|
||||||
|
assert rig.run(parsed_args) == 0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue