Add UnfilledModalError, records.verify_modal(), and .get_*() methods.

The .get_*() methods are used to verify that we aren't reading from a
pattern with un-filled modals.

The GeometryMixin class was also added here and provides some additional
convenience methods: get_xy() to get an (x,y) tuple and
get_layer_tuple() to get a (layer, datatype) tuple.
This commit is contained in:
Jan Petykiewicz 2020-05-19 00:42:42 -07:00
commit 705926d443
3 changed files with 131 additions and 12 deletions

View file

@ -59,6 +59,12 @@ class InvalidRecordError(FatamorganaError):
"""
pass
class UnfilledModalError(FatamorganaError):
"""
Attempted to call .get_var(), but var() was None!
"""
pass
class PathExtensionScheme(Enum):
"""
@ -2228,4 +2234,3 @@ def read_magic_bytes(stream: io.BufferedIOBase):
if magic != MAGIC_BYTES:
raise InvalidDataError('Could not read magic bytes, '
'found {!r} : {}'.format(magic, magic.decode()))