File tree 5 files changed +10
-13
lines changed
5 files changed +10
-13
lines changed Original file line number Diff line number Diff line change 1
1
"""
2
2
Useful regular expressions, intially just ``PUBLICATION_CODE``.
3
3
"""
4
+
4
5
import re
5
6
6
7
PUBLICATION_CODE = re .compile (r"\d{7}" )
Original file line number Diff line number Diff line change 43
43
DEFAULT_EXTRACTED_SUBDIR : Final [PathLike ] = Path ("extracted" )
44
44
45
45
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
+ )
49
49
TXT_FIXTURE_FILE_EXTENSION : Final [str ] = "txt"
50
50
TXT_FIXTURE_FILE_GLOB_REGEX : Final [str ] = f"**/*.{ TXT_FIXTURE_FILE_EXTENSION } "
51
51
DEFAULT_MAX_PLAINTEXT_PER_FIXTURE_FILE : Final [int ] = 100
@@ -77,7 +77,6 @@ class FulltextPathDict(TypedDict):
77
77
78
78
@dataclass
79
79
class PlainTextFixture :
80
-
81
80
"""Manage exporting `plaintext` `alto2txt` results for `lwmdb.fulltext.models.Fulltext`.
82
81
83
82
Attributes:
@@ -213,9 +212,9 @@ def __post_init__(self) -> None:
213
212
self ._check_and_set_files_attr (force = True )
214
213
self ._check_and_set_data_provider (force = True )
215
214
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
+ )
219
218
self ._pk_plaintext_dict : OrderedDict [PathLike , int ] = OrderedDict ()
220
219
221
220
def __len__ (self ) -> int :
Original file line number Diff line number Diff line change 19
19
a `docdict` configuration for running `newspaper` portions of `alto2txt2fixture`
20
20
21
21
"""
22
+
22
23
from typing import Final , Literal , TypeAlias
23
24
24
25
from .types import DataProviderFixtureDict , dotdict
Original file line number Diff line number Diff line change @@ -97,7 +97,6 @@ class TranslatorTuple(NamedTuple):
97
97
98
98
99
99
class PlaintextFixtureFieldsDict (TypedDict ):
100
-
101
100
"""A typed `dict` for Plaintext Fixutres to match `lwmdb.Fulltext` `model`
102
101
103
102
Attributes:
Original file line number Diff line number Diff line change 94
94
95
95
96
96
@overload
97
- def get_now (as_str : Literal [True ]) -> str :
98
- ...
97
+ def get_now (as_str : Literal [True ]) -> str : ...
99
98
100
99
101
100
@overload
102
- def get_now (as_str : Literal [False ]) -> datetime .datetime :
103
- ...
101
+ def get_now (as_str : Literal [False ]) -> datetime .datetime : ...
104
102
105
103
106
104
def get_now (as_str : bool = False ) -> datetime .datetime | str :
@@ -1045,7 +1043,6 @@ def path_globs_to_tuple(
1045
1043
1046
1044
1047
1045
class DiskUsageTuple (NamedTuple ):
1048
-
1049
1046
"""Type hint for `nametuple` returned from `disk_usage`."""
1050
1047
1051
1048
total : int
You can’t perform that action at this time.
0 commit comments