Compare commits
No commits in common. "trunk" and "iss1" have entirely different histories.
4 changed files with 4 additions and 34 deletions
|
|
@ -132,10 +132,8 @@ class WadMap(Wad):
|
||||||
]
|
]
|
||||||
if len(candidates) == 0:
|
if len(candidates) == 0:
|
||||||
raise Exception(
|
raise Exception(
|
||||||
"no suitable demo candidates for WAD {} MAP {}{}.".format(
|
"no suitable demo candidates for WAD {} MAP {} name {}.".format(
|
||||||
self.wad,
|
self.wad, self.map, self.name_string
|
||||||
self.map,
|
|
||||||
f" name {self._name}" if self._name else "",
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if len(candidates) == 1:
|
if len(candidates) == 1:
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ class Text(doomcc.doom_base.WadMap):
|
||||||
map_names = self._config.get("map_names")
|
map_names = self._config.get("map_names")
|
||||||
if map_names is not None:
|
if map_names is not None:
|
||||||
text = map_names.get(f"map{mapnum}")
|
text = map_names.get(f"map{mapnum}")
|
||||||
if text is not None:
|
if text != "":
|
||||||
return text
|
return text
|
||||||
|
|
||||||
return input("Map Name? ")
|
return input("Map Name? ")
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ description = "Doom Command Center"
|
||||||
authors = [
|
authors = [
|
||||||
{name = "yrriban",email = "yrriban@gmail.com"}
|
{name = "yrriban",email = "yrriban@gmail.com"}
|
||||||
]
|
]
|
||||||
license = "MIT"
|
license = {text = "MIT"}
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.12"
|
requires-python = ">=3.12"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
||||||
import doomcc.doom_base
|
|
||||||
import os
|
|
||||||
import pathlib
|
|
||||||
import pytest
|
|
||||||
import tempfile
|
|
||||||
|
|
||||||
class Workbench:
|
|
||||||
pass
|
|
||||||
|
|
||||||
def test_demo_in_path():
|
|
||||||
w = Workbench()
|
|
||||||
w.demo_in_path = lambda: doomcc.doom_base.WadMap.demo_in_path(w)
|
|
||||||
w._file_base = lambda path: doomcc.doom_base.WadMap._file_base(w, path)
|
|
||||||
w.wad = pathlib.Path("scythe")
|
|
||||||
w.map = "01"
|
|
||||||
w.name_string = "_index"
|
|
||||||
w._name = "index"
|
|
||||||
with tempfile.TemporaryDirectory() as td:
|
|
||||||
w.demos = pathlib.Path(td)
|
|
||||||
with pytest.raises(Exception):
|
|
||||||
w.demo_in_path()
|
|
||||||
|
|
||||||
dp = pathlib.Path(td).joinpath("scythe")
|
|
||||||
os.mkdir(dp)
|
|
||||||
dp.joinpath("scythe_map01_index.lmp").touch()
|
|
||||||
assert w.demo_in_path() == dp.joinpath("scythe_map01_index.lmp")
|
|
||||||
dp.joinpath("scythe_map01_index-00028.lmp").touch()
|
|
||||||
assert w.demo_in_path() == dp.joinpath("scythe_map01_index-00028.lmp")
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue