소스 검색

Fix return type of get_module_{class,instance}

No need to quote the class name since the methods are not inside the class (anymore)
tags/v1.0
JustAnotherArchivist 3 년 전
부모
커밋
90e0af88b9
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. +2
    -2
      codearchiver/core.py

+ 2
- 2
codearchiver/core.py 파일 보기

@@ -138,7 +138,7 @@ class Module:
return f'{type(self).__module__}.{type(self).__name__}({self._inputUrl!r})'


def get_module_class(inputUrl: InputURL) -> typing.Type['Module']:
def get_module_class(inputUrl: InputURL) -> typing.Type[Module]:
'''Get the Module class most suitable for handling `inputUrl`.'''

# Ensure that modules are imported
@@ -167,6 +167,6 @@ def get_module_class(inputUrl: InputURL) -> typing.Type['Module']:
raise RuntimeError('No matching modules for input URL')


def get_module_instance(inputUrl: InputURL, **kwargs) -> 'Module':
def get_module_instance(inputUrl: InputURL, **kwargs) -> Module:
'''Get an instance of the Module class most suitable for handling `inputUrl`.'''
return get_module_class(inputUrl)(inputUrl, **kwargs)

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