소스 검색

Add Module.name attribute

tags/v1.0
JustAnotherArchivist 4 년 전
부모
커밋
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')


불러오는 중...
취소
저장