Compare commits

..

No commits in common. "cd9265d0534c047537e1059685c91296282924fd" and "fcc6b2278557749c7d4b7400d66934934dbe28f8" have entirely different histories.

2 changed files with 8 additions and 17 deletions

View file

@ -1,12 +1,11 @@
import dcc.doom_base
import omg
import tomlkit.toml_file
class Configure(dcc.doom_base.Wad):
def get_parser(self, prog_name):
parser = super().get_parser(prog_name)
parser.add_argument("--complevel", "--cl")
parser.add_argument("complevel")
parser.add_argument("--iwad")
return parser
@ -15,21 +14,8 @@ class Configure(dcc.doom_base.Wad):
if new_config.exists():
raise Exception(f"Config {new_config} already exists.")
complevel = parsed_args.complevel
if complevel is None:
for w in self.load_order():
try:
wad = omg.WadIO(w)
complevel = wad.read("COMPLVL").decode("ascii").strip()
except Exception as e:
print(
f"Wad {w} likely has no lump COMPLVL (exception {e})")
if complevel is None:
complevel = input("Complevel? ")
doc = tomlkit.document()
doc.add("complevel", complevel)
doc.add("complevel", parsed_args.complevel)
if parsed_args.iwad is not None:
doc.add("iwad", parsed_args.iwad)

View file

@ -12,7 +12,12 @@ class Extract(dcc.doom_base.Wad):
return parser
def take_action(self, parsed_args):
for w in self.load_order()
wads = sorted(
self.pwads.joinpath(self.wad).glob('*.wad', case_sensitive=False),
reverse=True
)
for w in wads:
try:
# TODO: handle anything other than graphics.
wad = omg.WadIO(w)