浏览代码

Add Module.name attribute

tags/v1.0
JustAnotherArchivist 3 年前
父节点
当前提交
22c707c04f
共有 2 个文件被更改,包括 5 次插入0 次删除
  1. +3
    -0
      codearchiver/core.py
  2. +2
    -0
      codearchiver/modules/git.py

+ 3
- 0
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`.'''


+ 2
- 0
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')


正在加载...
取消
保存