Add support for rendering in the background.
This commit is contained in:
parent
cabb3dbb94
commit
ac29c5c49b
1 changed files with 10 additions and 1 deletions
|
@ -1,14 +1,23 @@
|
||||||
import contextlib
|
import contextlib
|
||||||
import dcc.config
|
import dcc.config
|
||||||
import dcc.doom_base
|
import dcc.doom_base
|
||||||
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
class Fabricate(dcc.doom_base.WadMap):
|
class Fabricate(dcc.doom_base.WadMap):
|
||||||
|
def get_parser(self, prog_name):
|
||||||
|
parser = super().get_parser(prog_name)
|
||||||
|
parser.add_argument("--fg", action="store_true")
|
||||||
|
return parser
|
||||||
|
|
||||||
def take_action(self, parsed_args):
|
def take_action(self, parsed_args):
|
||||||
with tempfile.TemporaryDirectory() as td:
|
with tempfile.TemporaryDirectory() as td:
|
||||||
with contextlib.chdir(td):
|
with contextlib.chdir(td):
|
||||||
subprocess.run([dcc.config.DSDA] +
|
command = [dcc.config.DSDA]
|
||||||
|
if not parsed_args.fg and shutil.which("xvfb-run") is not None:
|
||||||
|
command = ["xvfb-run"] + command
|
||||||
|
subprocess.run(command +
|
||||||
dcc.config.DsdaPreamble(parsed_args.wad, parsed_args.map) +
|
dcc.config.DsdaPreamble(parsed_args.wad, parsed_args.map) +
|
||||||
["-timedemo", dcc.config.DemoInPath(parsed_args.wad, parsed_args.map)] +
|
["-timedemo", dcc.config.DemoInPath(parsed_args.wad, parsed_args.map)] +
|
||||||
["-viddump", dcc.config.VideoPath(parsed_args.wad, parsed_args.map)])
|
["-viddump", dcc.config.VideoPath(parsed_args.wad, parsed_args.map)])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue