diff --git a/scripts/readers/base.py b/scripts/readers/base.py index 0a07aad..97edcfa 100644 --- a/scripts/readers/base.py +++ b/scripts/readers/base.py @@ -8,12 +8,6 @@ from typing import List, Optional, Tuple class BaseReader(ABC): """文档阅读器基类。""" - @property - @abstractmethod - def supported_extensions(self) -> List[str]: - """返回支持的文件扩展名列表(如 ['.docx', '.doc'])。""" - pass - @abstractmethod def supports(self, file_path: str) -> bool: """ diff --git a/scripts/readers/docx/__init__.py b/scripts/readers/docx/__init__.py index b4e243c..eec2fe3 100644 --- a/scripts/readers/docx/__init__.py +++ b/scripts/readers/docx/__init__.py @@ -27,10 +27,6 @@ PARSERS = [ class DocxReader(BaseReader): """DOCX 文件阅读器""" - @property - def supported_extensions(self) -> List[str]: - return [".docx"] - def supports(self, file_path: str) -> bool: return file_path.lower().endswith('.docx') diff --git a/scripts/readers/html/__init__.py b/scripts/readers/html/__init__.py index 295a9d5..ebbc476 100644 --- a/scripts/readers/html/__init__.py +++ b/scripts/readers/html/__init__.py @@ -26,10 +26,6 @@ PARSERS = [ class HtmlReader(BaseReader): """HTML/URL 文件阅读器""" - @property - def supported_extensions(self) -> List[str]: - return [".html", ".htm"] - def supports(self, file_path: str) -> bool: return is_url(file_path) or file_path.lower().endswith(('.html', '.htm')) diff --git a/scripts/readers/pdf/__init__.py b/scripts/readers/pdf/__init__.py index 3f8f589..9f175b0 100644 --- a/scripts/readers/pdf/__init__.py +++ b/scripts/readers/pdf/__init__.py @@ -27,10 +27,6 @@ PARSERS = [ class PdfReader(BaseReader): """PDF 文件阅读器""" - @property - def supported_extensions(self) -> List[str]: - return [".pdf"] - def supports(self, file_path: str) -> bool: return file_path.lower().endswith('.pdf') diff --git a/scripts/readers/pptx/__init__.py b/scripts/readers/pptx/__init__.py index eea4c00..6a92910 100644 --- a/scripts/readers/pptx/__init__.py +++ b/scripts/readers/pptx/__init__.py @@ -25,10 +25,6 @@ PARSERS = [ class PptxReader(BaseReader): """PPTX 文件阅读器""" - @property - def supported_extensions(self) -> List[str]: - return [".pptx"] - def supports(self, file_path: str) -> bool: return file_path.lower().endswith('.pptx') diff --git a/scripts/readers/xlsx/__init__.py b/scripts/readers/xlsx/__init__.py index 29fd84b..8856e97 100644 --- a/scripts/readers/xlsx/__init__.py +++ b/scripts/readers/xlsx/__init__.py @@ -25,10 +25,6 @@ PARSERS = [ class XlsxReader(BaseReader): """XLSX 文件阅读器""" - @property - def supported_extensions(self) -> List[str]: - return [".xlsx"] - def supports(self, file_path: str) -> bool: return file_path.lower().endswith('.xlsx')