Compare commits
2 commits
35894c2614
...
c89fde220c
Author | SHA1 | Date | |
---|---|---|---|
c89fde220c | |||
70c36ac615 |
2 changed files with 14 additions and 2 deletions
|
@ -19,7 +19,14 @@ class Wad(dcc.config.Base):
|
||||||
wcp = self.pwads.joinpath(self.wad).joinpath(self.config_name)
|
wcp = self.pwads.joinpath(self.wad).joinpath(self.config_name)
|
||||||
if wcp.exists():
|
if wcp.exists():
|
||||||
self._wad_config = tomlkit.toml_file.TOMLFile(wcp).read()
|
self._wad_config = tomlkit.toml_file.TOMLFile(wcp).read()
|
||||||
self._config.update(self._wad_config.value)
|
for k,v in self._wad_config.items():
|
||||||
|
if isinstance(v, dict):
|
||||||
|
if not k in self._config:
|
||||||
|
self._config[k] = {}
|
||||||
|
for sk in v:
|
||||||
|
self._config[k][sk] = v[sk]
|
||||||
|
else:
|
||||||
|
self._config[k] = v
|
||||||
|
|
||||||
def run(self, parsed_args):
|
def run(self, parsed_args):
|
||||||
self.wad_init(parsed_args)
|
self.wad_init(parsed_args)
|
||||||
|
|
|
@ -32,7 +32,12 @@ class Text(dcc.doom_base.WadMap):
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
def take_action(self, parsed_args):
|
def take_action(self, parsed_args):
|
||||||
text = sys.stdin.read().rstrip()
|
text = None
|
||||||
|
map_names = self._config["map_names"]
|
||||||
|
if map_names is not None:
|
||||||
|
text = map_names[f"map{parsed_args.map}"]
|
||||||
|
if text is None:
|
||||||
|
text = sys.stdin.read().rstrip()
|
||||||
if not parsed_args.nomap:
|
if not parsed_args.nomap:
|
||||||
text = "MAP{}: {}".format(parsed_args.map, text)
|
text = "MAP{}: {}".format(parsed_args.map, text)
|
||||||
text = "{}\n{}".format(text, parsed_args.demotype)
|
text = "{}\n{}".format(text, parsed_args.demotype)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue