|
|
@@ -235,7 +235,7 @@ class ModuleMeta(type): |
|
|
|
def __new__(cls, *args, **kwargs): |
|
|
|
class_ = super().__new__(cls, *args, **kwargs) |
|
|
|
if class_.name is not None: |
|
|
|
if class_.name.strip('abcdefghijklmnopqrstuvwxyz_-') != '': |
|
|
|
if class_.name.strip('abcdefghijklmnopqrstuvwxyz-') != '': |
|
|
|
raise RuntimeError(f'Invalid class name: {class_.name!r}') |
|
|
|
if class_.name in cls.__modulesByName: |
|
|
|
raise RuntimeError(f'Class name collision: {class_.name!r} is already known') |
|
|
@@ -297,7 +297,7 @@ class Module(metaclass = ModuleMeta): |
|
|
|
'''An abstract base class for a module.''' |
|
|
|
|
|
|
|
name: typing.Optional[str] = None |
|
|
|
'''The name of the module. Modules without a name are ignored. Names must be unique and may only contain a-z, underscores, and hyphens.''' |
|
|
|
'''The name of the module. Modules without a name are ignored. Names must be unique and may only contain a-z and hyphens.''' |
|
|
|
|
|
|
|
@staticmethod |
|
|
|
def matches(inputUrl: InputURL) -> bool: |
|
|
|