for s in default_strs:
res = parser_complete(self.parse)(s)
if isinstance(res, ParseError):
- raise ConfigException(
+ raise Exception(
"Failed to construct defaulted field " + self.name()
)
acc.append(res[0])
prompt: list[ColoredLine]
maze_pattern: list[str]
- def __init__(self) -> None:
- pass
-
@staticmethod
def parse(s: str) -> "Config":
from mazegen.maze import Pattern
from collections.abc import Callable
from typing import Any
import textwrap
+from dataclasses import dataclass
from mazegen.utils.ivec2 import IVec2
except curses.error:
pass # dumb exception when writing bottom right corner
- if (
- len(pixels) > dims.y
- or max(
- map(lambda line: sum(map(lambda s: len(s[0]), line)), pixels)
- )
- > dims.x
- ):
- raise BackendException("Tile too big to fit in set dimensions")
+ pixels = [
+ [pixel for pixel in line[: dims.y]] for line in pixels[: dims.y]
+ ]
super().__init__(curses.newpad(*dims.yx()))