Ver a proveniência

Disallow underscores in module names

Using the preferred file naming scheme of {moduleName}_{someInputURLDerivative}_{date}*, this allows mapping files to modules without ambiguity.
tags/v1.0
JustAnotherArchivist há 1 ano
ascendente
cometimento
2257305872
1 ficheiros alterados com 2 adições e 2 eliminações
  1. +2
    -2
      codearchiver/core.py

+ 2
- 2
codearchiver/core.py Ver ficheiro

@@ -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:


Carregando…
Cancelar
Guardar