From 30baa49588602f9b49a78ca8a12342b653c0aa4f Mon Sep 17 00:00:00 2001 From: yrriban Date: Sun, 20 Jul 2025 01:52:50 -0400 Subject: [PATCH 1/4] Fix text stroke color reference in the concat command. --- dcc/concat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dcc/concat.py b/dcc/concat.py index 6198de3..6493037 100644 --- a/dcc/concat.py +++ b/dcc/concat.py @@ -92,7 +92,7 @@ class Concat(dcc.doom_base.Wad): ) img.trim(reset_coords=True) img.border("graya(25%, 25%)", 10, 10) - img.border(dcc.config.TEXT_STROKE_COLOR, 16, 16) + img.border(self.thumbnail_text_stroke, 16, 16) # for this to work... the image needs to have a width that's a # multiple of 8. dude whyyyyyyy padfactor = 8 From 114fec8f7ead4f6e93dc2ebe4289f1b2148ae0ec Mon Sep 17 00:00:00 2001 From: yrriban Date: Wed, 23 Jul 2025 18:26:11 -0400 Subject: [PATCH 2/4] Fix the extract command to work with the new nested config classes. --- dcc/extract.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/dcc/extract.py b/dcc/extract.py index 8d38289..a61b446 100644 --- a/dcc/extract.py +++ b/dcc/extract.py @@ -1,14 +1,13 @@ -import dcc.config +import dcc.doom_base import omg import numpy as np import wand.color import wand.image -class Extract(dcc.config.base): +class Extract(dcc.doom_base.Wad): def get_parser(self, prog_name): parser = super().get_parser(prog_name) - parser.add_argument('wad') parser.add_argument('lump') return parser @@ -30,17 +29,17 @@ class Extract(dcc.config.base): ) as img: img.transparent_color(wand.color.Color("#ff00ff"), 0.0) img.save( - filename=self.output.joinpath(parsed_args.wad) + filename=self.fabricate.joinpath(parsed_args.wad) .joinpath(parsed_args.lump + ".png") ) return except Exception as e: print( - f"Wad {w} likely has no lump {parsed_args.lump}" + f"Wad {w} likely has no lump {parsed_args.lump} " + f"(exception {e})." ) print( - "Lump {parsed_args.lump} not found in any wad in" + "Lump {parsed_args.lump} not found in any wad in " + f"{parsed_args.wad}" ) From 366ddf613239ae807b0469c447ea8f6000ca4484 Mon Sep 17 00:00:00 2001 From: yrriban Date: Wed, 23 Jul 2025 18:26:45 -0400 Subject: [PATCH 3/4] Properly handle overwriting values in a wad-level config. This only was a problem for values that we were geenerating a property for. --- dcc/config.py | 2 ++ dcc/doom_base.py | 1 + 2 files changed, 3 insertions(+) diff --git a/dcc/config.py b/dcc/config.py index c1ed346..ac51da2 100644 --- a/dcc/config.py +++ b/dcc/config.py @@ -20,6 +20,7 @@ class Base(Command): self._config_name = parsed_args.config_name self._config = tomlkit.toml_file.TOMLFile( self.doom.joinpath(self.config_name)).read() + self._dsda = self._config.get("dsda") if self.dsda is None: raise Exception( @@ -28,6 +29,7 @@ class Base(Command): for d in ("iwads", "pwads", "demos", "fabricate"): self._init_attr([d], d, fn=self.doom.joinpath) + def finalize(self): self._init_attr(["thumbnail", "height"], 720) self._init_attr(["thumbnail", "width"], 1280) self._init_attr(["thumbnail", "font"], None) diff --git a/dcc/doom_base.py b/dcc/doom_base.py index 39c7fdc..ad2bf39 100644 --- a/dcc/doom_base.py +++ b/dcc/doom_base.py @@ -27,6 +27,7 @@ class Wad(dcc.config.Base): self._config[k][sk] = v[sk] else: self._config[k] = v + self.finalize() def run(self, parsed_args): self.wad_init(parsed_args) From 469d8eb13ab67f67031aaea60e3b0dfcab00af17 Mon Sep 17 00:00:00 2001 From: yrriban Date: Wed, 23 Jul 2025 18:29:15 -0400 Subject: [PATCH 4/4] PEP 8 compliance. --- dcc/doom_base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dcc/doom_base.py b/dcc/doom_base.py index ad2bf39..317791b 100644 --- a/dcc/doom_base.py +++ b/dcc/doom_base.py @@ -19,9 +19,9 @@ class Wad(dcc.config.Base): wcp = self.pwads.joinpath(self.wad).joinpath(self.config_name) if wcp.exists(): self._wad_config = tomlkit.toml_file.TOMLFile(wcp).read() - for k,v in self._wad_config.items(): + for k, v in self._wad_config.items(): if isinstance(v, dict): - if not k in self._config: + if k not in self._config: self._config[k] = {} for sk in v: self._config[k][sk] = v[sk]