diff --git a/codearchiver/core.py b/codearchiver/core.py index f8df532..afb5fee 100644 --- a/codearchiver/core.py +++ b/codearchiver/core.py @@ -119,6 +119,9 @@ class HttpClient: class Module: '''An abstract base class for a module.''' + name: typing.Optional[str] = None + '''The name of the module. Modules without a name are ignored, and names must be unique.''' + @staticmethod def matches(inputUrl: InputURL) -> bool: '''Whether or not this module is for handling `inputUrl`.''' diff --git a/codearchiver/modules/git.py b/codearchiver/modules/git.py index 4b27b75..b50f6de 100644 --- a/codearchiver/modules/git.py +++ b/codearchiver/modules/git.py @@ -10,6 +10,8 @@ logger = logging.getLogger(__name__) class Git(codearchiver.core.Module): + name = 'git' + @staticmethod def matches(inputUrl): return inputUrl.url.endswith('.git')