Skip to content

Commit 64700ad

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 5dbbf3c commit 64700ad

File tree

5 files changed

+10
-13
lines changed

5 files changed

+10
-13
lines changed

alto2txt2fixture/patterns.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Useful regular expressions, intially just ``PUBLICATION_CODE``.
33
"""
4+
45
import re
56

67
PUBLICATION_CODE = re.compile(r"\d{7}")

alto2txt2fixture/plaintext.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343
DEFAULT_EXTRACTED_SUBDIR: Final[PathLike] = Path("extracted")
4444

4545
FULLTEXT_FILE_NAME_SUFFIX: Final[str] = "_plaintext"
46-
FULLTEXT_DEFAULT_PLAINTEXT_ZIP_GLOB_REGEX: Final[
47-
str
48-
] = f"*{FULLTEXT_FILE_NAME_SUFFIX}.{ZIP_FILE_EXTENSION}"
46+
FULLTEXT_DEFAULT_PLAINTEXT_ZIP_GLOB_REGEX: Final[str] = (
47+
f"*{FULLTEXT_FILE_NAME_SUFFIX}.{ZIP_FILE_EXTENSION}"
48+
)
4949
TXT_FIXTURE_FILE_EXTENSION: Final[str] = "txt"
5050
TXT_FIXTURE_FILE_GLOB_REGEX: Final[str] = f"**/*.{TXT_FIXTURE_FILE_EXTENSION}"
5151
DEFAULT_MAX_PLAINTEXT_PER_FIXTURE_FILE: Final[int] = 100
@@ -77,7 +77,6 @@ class FulltextPathDict(TypedDict):
7777

7878
@dataclass
7979
class PlainTextFixture:
80-
8180
"""Manage exporting `plaintext` `alto2txt` results for `lwmdb.fulltext.models.Fulltext`.
8281
8382
Attributes:
@@ -213,9 +212,9 @@ def __post_init__(self) -> None:
213212
self._check_and_set_files_attr(force=True)
214213
self._check_and_set_data_provider(force=True)
215214
self._disk_usage: DiskUsageTuple = disk_usage(self.path)
216-
self._uncompressed_source_file_dict: OrderedDict[
217-
PathLike, PathLike
218-
] = OrderedDict()
215+
self._uncompressed_source_file_dict: OrderedDict[PathLike, PathLike] = (
216+
OrderedDict()
217+
)
219218
self._pk_plaintext_dict: OrderedDict[PathLike, int] = OrderedDict()
220219

221220
def __len__(self) -> int:

alto2txt2fixture/settings.py

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
a `docdict` configuration for running `newspaper` portions of `alto2txt2fixture`
2020
2121
"""
22+
2223
from typing import Final, Literal, TypeAlias
2324

2425
from .types import DataProviderFixtureDict, dotdict

alto2txt2fixture/types.py

-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ class TranslatorTuple(NamedTuple):
9797

9898

9999
class PlaintextFixtureFieldsDict(TypedDict):
100-
101100
"""A typed `dict` for Plaintext Fixutres to match `lwmdb.Fulltext` `model`
102101
103102
Attributes:

alto2txt2fixture/utils.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,11 @@
9494

9595

9696
@overload
97-
def get_now(as_str: Literal[True]) -> str:
98-
...
97+
def get_now(as_str: Literal[True]) -> str: ...
9998

10099

101100
@overload
102-
def get_now(as_str: Literal[False]) -> datetime.datetime:
103-
...
101+
def get_now(as_str: Literal[False]) -> datetime.datetime: ...
104102

105103

106104
def get_now(as_str: bool = False) -> datetime.datetime | str:
@@ -1045,7 +1043,6 @@ def path_globs_to_tuple(
10451043

10461044

10471045
class DiskUsageTuple(NamedTuple):
1048-
10491046
"""Type hint for `nametuple` returned from `disk_usage`."""
10501047

10511048
total: int

0 commit comments

Comments
 (0)