Procházet zdrojové kódy

Add Module.name attribute

tags/v1.0
JustAnotherArchivist před 3 roky
rodič
revize
22c707c04f
2 změnil soubory, kde provedl 5 přidání a 0 odebrání
  1. +3
    -0
      codearchiver/core.py
  2. +2
    -0
      codearchiver/modules/git.py

+ 3
- 0
codearchiver/core.py Zobrazit soubor

@@ -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 Zobrazit soubor

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


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

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


Načítá se…
Zrušit
Uložit