Browse Source

Add Module.name attribute

tags/v1.0
JustAnotherArchivist 3 years ago
parent
commit
22c707c04f
2 changed files with 5 additions and 0 deletions
  1. +3
    -0
      codearchiver/core.py
  2. +2
    -0
      codearchiver/modules/git.py

+ 3
- 0
codearchiver/core.py View File

@@ -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`.'''


+ 2
- 0
codearchiver/modules/git.py View File

@@ -10,6 +10,8 @@ logger = logging.getLogger(__name__)


class Git(codearchiver.core.Module):
name = 'git'

@staticmethod
def matches(inputUrl):
return inputUrl.url.endswith('.git')


Loading…
Cancel
Save