chore: Fix for additional linting rules

This commit is contained in:
Marty Oehme 2025-09-11 13:38:47 +02:00
parent 96cd4929c9
commit f5455b6946
Signed by: Marty
GPG key ID: 4E535BC19C61886E
7 changed files with 58 additions and 40 deletions

View file

@ -17,7 +17,7 @@ class ReadEraExtractor:
"""
def can_process(self, filename: Path) -> bool:
if not magic.from_file(filename, mime=True) == "text/plain":
if magic.from_file(filename, mime=True) != "text/plain":
return False
content = self._read_file(filename)
@ -83,8 +83,8 @@ class ReadEraExtractor:
def _read_file(self, filename: Path) -> list[str]:
try:
with open(filename, encoding="utf-8") as f:
return f.readlines()
with filename.open("r") as fr:
return fr.readlines()
except FileNotFoundError:
logger.error(f"Could not open file {filename} for extraction.")
return []