mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-08-16 00:36:22 +00:00
Chore: Enable ruff FBT (#8645)
This commit is contained in:

committed by
GitHub

parent
b274665e21
commit
e560fa3be0
@@ -10,7 +10,7 @@ if TYPE_CHECKING:
|
||||
|
||||
|
||||
class BulkArchiveStrategy:
|
||||
def __init__(self, zipf: ZipFile, follow_formatting: bool = False) -> None:
|
||||
def __init__(self, zipf: ZipFile, *, follow_formatting: bool = False) -> None:
|
||||
self.zipf: ZipFile = zipf
|
||||
if follow_formatting:
|
||||
self.make_unique_filename: Callable[..., Path | str] = (
|
||||
@@ -22,6 +22,7 @@ class BulkArchiveStrategy:
|
||||
def _filename_only(
|
||||
self,
|
||||
doc: Document,
|
||||
*,
|
||||
archive: bool = False,
|
||||
folder: str = "",
|
||||
) -> str:
|
||||
@@ -33,7 +34,10 @@ class BulkArchiveStrategy:
|
||||
"""
|
||||
counter = 0
|
||||
while True:
|
||||
filename: str = folder + doc.get_public_filename(archive, counter)
|
||||
filename: str = folder + doc.get_public_filename(
|
||||
archive=archive,
|
||||
counter=counter,
|
||||
)
|
||||
if filename in self.zipf.namelist():
|
||||
counter += 1
|
||||
else:
|
||||
@@ -42,6 +46,7 @@ class BulkArchiveStrategy:
|
||||
def _formatted_filepath(
|
||||
self,
|
||||
doc: Document,
|
||||
*,
|
||||
archive: bool = False,
|
||||
folder: str = "",
|
||||
) -> Path:
|
||||
|
Reference in New Issue
Block a user