mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Runs pyupgrade to Python 3.8+ and adds a hook for it
This commit is contained in:
@@ -18,7 +18,7 @@ class TextDocumentParser(DocumentParser):
|
||||
|
||||
def get_thumbnail(self, document_path, mime_type, file_name=None):
|
||||
def read_text():
|
||||
with open(document_path, "r") as src:
|
||||
with open(document_path) as src:
|
||||
lines = [line.strip() for line in src.readlines()]
|
||||
text = "\n".join(lines[:50])
|
||||
return text
|
||||
@@ -38,5 +38,5 @@ class TextDocumentParser(DocumentParser):
|
||||
return out_path
|
||||
|
||||
def parse(self, document_path, mime_type, file_name=None):
|
||||
with open(document_path, "r") as f:
|
||||
with open(document_path) as f:
|
||||
self.text = f.read()
|
||||
|
Reference in New Issue
Block a user