Use os.execv instead of subprocess.run when no further action is taken.
This prevents the underlying file from being marked busy while a long-running action is happening (e.g. eureka is open).
This commit is contained in:
parent
21bdcf3e17
commit
edbf4f2a0e
7 changed files with 23 additions and 25 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import dcc.doom_base
|
||||
import dcc.config
|
||||
import subprocess
|
||||
import os
|
||||
|
||||
|
||||
class Eureka(dcc.doom_base.WadMap):
|
||||
|
|
@ -24,7 +24,7 @@ class Eureka(dcc.doom_base.WadMap):
|
|||
if complevel == "11" or complevel == "21":
|
||||
port = "mbf"
|
||||
|
||||
subprocess.run(
|
||||
os.execvp("eureka",
|
||||
["eureka"] + ["-iwad", iwad] + ["-w", parsed_args.map]
|
||||
+ ["-p", port] + [mw]
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import contextlib
|
||||
import dcc.config
|
||||
import dcc.doom_base
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import tempfile
|
||||
|
||||
|
||||
|
|
@ -18,7 +18,7 @@ class Fabricate(dcc.doom_base.WadMap):
|
|||
command = [self.dsda]
|
||||
if not parsed_args.fg and shutil.which("xvfb-run") is not None:
|
||||
command = ["xvfb-run"] + command
|
||||
subprocess.run(
|
||||
os.execvp(command[0],
|
||||
command + self.dsda_preamble()
|
||||
+ ["-timedemo", self.demo_in_path()]
|
||||
+ ["-viddump", self.video_path()]
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import dcc.config
|
||||
import dcc.doom_base
|
||||
import subprocess
|
||||
import os
|
||||
|
||||
|
||||
class PB(dcc.doom_base.WadMap):
|
||||
def take_action(self, parsed_args):
|
||||
subprocess.run(["ffplay", self.video_path()])
|
||||
os.execvp("ffplay", ["ffplay", self.video_path()])
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import dcc.config
|
||||
import dcc.doom_base
|
||||
import subprocess
|
||||
import os
|
||||
|
||||
|
||||
class Play(dcc.doom_base.WadMap):
|
||||
def take_action(self, parsed_args):
|
||||
subprocess.run([self.dsda] + self.dsda_preamble())
|
||||
os.execv(self.dsda, [self.dsda] + self.dsda_preamble())
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import dcc.config
|
||||
import dcc.doom_base
|
||||
import subprocess
|
||||
import os
|
||||
|
||||
|
||||
class Record(dcc.doom_base.WadMap):
|
||||
def take_action(self, parsed_args):
|
||||
subprocess.run(
|
||||
os.execv(self.dsda,
|
||||
[self.dsda] + self.dsda_preamble() +
|
||||
["-record", self.demo_out_path()]
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import dcc.doom_base
|
||||
import pathlib
|
||||
import os
|
||||
import subprocess
|
||||
import time
|
||||
|
||||
|
||||
|
|
@ -42,7 +41,7 @@ class RIB(dcc.doom_base.WadMap):
|
|||
+ f"and map {parsed_args.map} (tried to look in {demodir})"
|
||||
)
|
||||
|
||||
subprocess.run(
|
||||
os.execv(self.dsda,
|
||||
[self.dsda] + self.dsda_preamble(warp=False)
|
||||
+ ["-playdemo", demo]
|
||||
+ ["-skiptic", str(-35 * parsed_args.secs_before)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue