Fix various errors in the previous commit.

This commit is contained in:
yrriban 2025-05-13 10:04:43 -04:00
parent 2438995093
commit 606f27185c

View file

@ -3,7 +3,7 @@ from cliff.command import Command
import dcc.config import dcc.config
import io import io
class WadMap(Command): class WadMap(dcc.config.Base):
def get_parser(self, prog_name): def get_parser(self, prog_name):
parser = super().get_parser(prog_name) parser = super().get_parser(prog_name)
parser.add_argument('wad') parser.add_argument('wad')
@ -65,33 +65,33 @@ class WadMap(Command):
return sorted(filter(lambda s : re.search("-", str(s)), candidates))[-1] return sorted(filter(lambda s : re.search("-", str(s)), candidates))[-1]
def dsda_text_path(self): def dsda_text_path(self):
return _ensure(dcc.config.DEMOS.joinpath(self.wad)).joinpath(self._file_base(".txt")) return self._ensure(dcc.config.DEMOS.joinpath(self.wad)).joinpath(self._file_base(".txt"))
def video_path(self): def video_path(self):
return _ensure(dcc.config.OUTPUT.joinpath(self.wad)).joinpath(self._file_base(".mp4")) return self._ensure(dcc.config.OUTPUT.joinpath(self.wad)).joinpath(self._file_base(".mp4"))
def demo_out_path(self): def demo_out_path(self):
return _ensure(dcc.config.DEMOS.joinpath(self.wad)).joinpath(self._file_base(".lmp")) return self._ensure(dcc.config.DEMOS.joinpath(self.wad)).joinpath(self._file_base(".lmp"))
def target_bucket(self): def target_bucket(self):
return "doom/" + self._file_base(".lmp") return "doom/" + self._file_base(".lmp")
def base_thumb_path(self): def base_thumb_path(self):
return _ensure(dcc.config.OUTPUT.joinpath(self.wad)).joinpath(_file_base("_base.png")) return self._ensure(dcc.config.OUTPUT.joinpath(self.wad)).joinpath(_file_base("_base.png"))
def m_doom_path(self): def m_doom_path(self):
return _ensure(OUTPUT.joinpath(self.wad)).joinpath("M_DOOM_scaled.png") return self._ensure(OUTPUT.joinpath(self.wad)).joinpath("M_DOOM_scaled.png")
def text_thumb_path(self): def text_thumb_path(self):
return _ensure(dcc.config.OUTPUT.joinpath(self.wad)).joinpath(_file_base("_text.png")) return self._ensure(dcc.config.OUTPUT.joinpath(self.wad)).joinpath(_file_base("_text.png"))
def thumb_path(self): def thumb_path(self):
return _ensure(dcc.config.OUTPUT.joinpath(self.wad)).joinpath(_file_base("_thumb.png")) return self._ensure(dcc.config.OUTPUT.joinpath(self.wad)).joinpath(_file_base("_thumb.png"))
def _file_base(self, ext): def _file_base(self, ext):
return "{}_map{}{}{}".format(self.wad, self.map, self.name_string, ext) return "{}_map{}{}{}".format(self.wad, self.map, self.name_string, ext)
def _ensure(path): def _ensure(self, path):
if not path.exists(): if not path.exists():
os.mkdir(path) os.mkdir(path)
return path return path