BabelDOC 0.2.31__tar.gz → 0.2.32__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {babeldoc-0.2.31 → babeldoc-0.2.32}/PKG-INFO +1 -1
- babeldoc-0.2.32/babeldoc/__init__.py +1 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/const.py +1 -1
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/high_level.py +12 -12
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/main.py +1 -1
- babeldoc-0.2.32/babeldoc/tools/italic_assistance.py +205 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/pyproject.toml +2 -2
- {babeldoc-0.2.31 → babeldoc-0.2.32}/uv.lock +1 -1
- babeldoc-0.2.31/babeldoc/__init__.py +0 -1
- {babeldoc-0.2.31 → babeldoc-0.2.32}/.cursorignore +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/.github/ISSUE_TEMPLATE/bug_report.yaml +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/.github/ISSUE_TEMPLATE/feature_request.yaml +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/.github/dependabot.yml +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/.github/labels.yml +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/.github/release-drafter.yml +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/.github/workflows/codeql.yml +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/.github/workflows/docs.yml +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/.github/workflows/labeler.yml +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/.github/workflows/publish-to-pypi.yml +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/.github/workflows/test.yml +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/.gitignore +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/.pre-commit-config.yaml +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/LICENSE +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/README.md +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/assets/assets.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/assets/embedding_assets_metadata.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/asynchronize/__init__.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/converter.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/document_il/__init__.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/document_il/babeldoc_exception/BabelDOCException.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/document_il/backend/__init__.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/document_il/backend/pdf_creater.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/document_il/frontend/__init__.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/document_il/frontend/il_creater.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/document_il/il_version_1.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/document_il/il_version_1.rnc +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/document_il/il_version_1.rng +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/document_il/il_version_1.xsd +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/document_il/midend/__init__.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/document_il/midend/add_debug_information.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/document_il/midend/detect_scanned_file.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/document_il/midend/il_translator.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/document_il/midend/il_translator_llm_only.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/document_il/midend/layout_parser.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/document_il/midend/paragraph_finder.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/document_il/midend/remove_descent.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/document_il/midend/styles_and_formulas.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/document_il/midend/table_parser.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/document_il/midend/typesetting.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/document_il/translator/__init__.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/document_il/translator/cache.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/document_il/translator/translator.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/document_il/utils/atomic_integer.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/document_il/utils/fontmap.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/document_il/utils/layout_helper.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/document_il/utils/priority_thread_pool_executor.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/document_il/utils/style_helper.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/document_il/xml_converter.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/docvision/README.md +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/docvision/__init__.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/docvision/doclayout.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/docvision/rpc_doclayout.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/docvision/table_detection/rapidocr.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/pdfinterp.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/progress_monitor.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/result_merger.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/split_manager.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/tools/generate_font_metadata.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/translation_config.py +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/docs/CODE_OF_CONDUCT.md +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/docs/CONTRIBUTING.md +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/docs/CONTRIBUTOR_REWARD.md +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/docs/ImplementationDetails/AsyncTranslate/AsyncTranslate.md +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/docs/ImplementationDetails/ILTranslator/ILTranslator.md +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/docs/ImplementationDetails/PDFCreation/PDFCreation.md +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/docs/ImplementationDetails/PDFParsing/PDFParsing.md +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/docs/ImplementationDetails/ParagraphFinding/ParagraphFinding.md +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/docs/ImplementationDetails/README.md +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/docs/ImplementationDetails/StylesAndFormulas/StylesAndFormulas.md +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/docs/ImplementationDetails/Typesetting/Typesetting.md +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/docs/README.md +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/docs/deploy.sh +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/docs/images/babeldoc-banner.png +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/docs/images/babeldoc-big-logo-darkmode-with-transparent-background.png +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/docs/images/babeldoc-big-logo-darkmode-with-transparent-background.svg +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/docs/images/babeldoc-big-logo-with-transparent-background.png +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/docs/images/babeldoc-big-logo-with-transparent-background.svg +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/docs/images/babeldoc-big-logo.png +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/docs/images/babeldoc-contributor_reward_example.png +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/docs/images/babeldoc-preview.gif +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/docs/images/babeldoc-small-logo-with-transparent-background.png +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/docs/images/babeldoc-small-logo-with-transparent-background.svg +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/docs/images/babeldoc-small-logo.png +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/docs/index.md +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/docs/intro-to-pdf-object.md +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/docs/requirements.txt +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/mkdocs.yml +0 -0
- {babeldoc-0.2.31 → babeldoc-0.2.32}/tests/test_translation_config.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.2.32"
|
|
@@ -49,19 +49,19 @@ from babeldoc.translation_config import WatermarkOutputMode
|
|
|
49
49
|
logger = logging.getLogger(__name__)
|
|
50
50
|
|
|
51
51
|
TRANSLATE_STAGES = [
|
|
52
|
-
(ILCreater.stage_name,
|
|
53
|
-
(DetectScannedFile.stage_name,
|
|
54
|
-
(LayoutParser.stage_name,
|
|
55
|
-
(TableParser.stage_name, 0
|
|
56
|
-
(ParagraphFinder.stage_name,
|
|
57
|
-
(StylesAndFormulas.stage_name, 1.
|
|
52
|
+
(ILCreater.stage_name, 14.12), # Parse PDF and Create IR
|
|
53
|
+
(DetectScannedFile.stage_name, 2.45), # DetectScannedFile
|
|
54
|
+
(LayoutParser.stage_name, 14.03), # Parse Page Layout
|
|
55
|
+
(TableParser.stage_name, 1.0), # Parse Table
|
|
56
|
+
(ParagraphFinder.stage_name, 6.26), # Parse Paragraphs
|
|
57
|
+
(StylesAndFormulas.stage_name, 1.66), # Parse Formulas and Styles
|
|
58
58
|
# (RemoveDescent.stage_name, 0.15), # Remove Char Descent
|
|
59
|
-
(ILTranslator.stage_name,
|
|
60
|
-
(Typesetting.stage_name,
|
|
61
|
-
(FontMapper.stage_name, 0.
|
|
62
|
-
(PDFCreater.stage_name, 1.
|
|
63
|
-
(SUBSET_FONT_STAGE_NAME,
|
|
64
|
-
(SAVE_PDF_STAGE_NAME,
|
|
59
|
+
(ILTranslator.stage_name, 46.96), # Translate Paragraphs
|
|
60
|
+
(Typesetting.stage_name, 4.71), # Typesetting
|
|
61
|
+
(FontMapper.stage_name, 0.61), # Add Fonts
|
|
62
|
+
(PDFCreater.stage_name, 1.96), # Generate drawing instructions
|
|
63
|
+
(SUBSET_FONT_STAGE_NAME, 0.92), # Subset font
|
|
64
|
+
(SAVE_PDF_STAGE_NAME, 6.34), # Save PDF
|
|
65
65
|
]
|
|
66
66
|
|
|
67
67
|
resfont_map = {
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
import json
|
|
3
|
+
import re
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
import orjson
|
|
7
|
+
from babeldoc.const import CACHE_FOLDER
|
|
8
|
+
|
|
9
|
+
WORKING_FOLDER = Path(CACHE_FOLDER) / "working"
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def find_latest_il_json() -> Path | None:
|
|
13
|
+
"""
|
|
14
|
+
Find the latest il_translated.json file in ~/.cache/babeldoc/ subdirectories.
|
|
15
|
+
|
|
16
|
+
Returns:
|
|
17
|
+
Path to the most recently modified il_translated.json file, or None if not found.
|
|
18
|
+
"""
|
|
19
|
+
base_dir = Path(WORKING_FOLDER)
|
|
20
|
+
json_files = list(base_dir.glob("*/il_translated.json"))
|
|
21
|
+
|
|
22
|
+
if not json_files:
|
|
23
|
+
return None
|
|
24
|
+
|
|
25
|
+
# Sort by modification time (newest first)
|
|
26
|
+
json_files.sort(key=lambda p: p.stat().st_mtime, reverse=True)
|
|
27
|
+
return json_files[0]
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def extract_fonts_from_paragraph(
|
|
31
|
+
paragraph: dict, page_font_map: dict[str, tuple[str, str]]
|
|
32
|
+
) -> set[tuple[str, str]]:
|
|
33
|
+
"""
|
|
34
|
+
Extract all font_ids and names used in a paragraph.
|
|
35
|
+
|
|
36
|
+
Args:
|
|
37
|
+
paragraph: The paragraph dictionary
|
|
38
|
+
page_font_map: Dictionary mapping font_id to (font_id, name) tuples
|
|
39
|
+
|
|
40
|
+
Returns:
|
|
41
|
+
Set of (font_id, name) tuples
|
|
42
|
+
"""
|
|
43
|
+
fonts = set()
|
|
44
|
+
|
|
45
|
+
# Check if paragraph has a pdfStyle with font_id
|
|
46
|
+
if (
|
|
47
|
+
"pdf_style" in paragraph
|
|
48
|
+
and paragraph["pdf_style"]
|
|
49
|
+
and "font_id" in paragraph["pdf_style"]
|
|
50
|
+
):
|
|
51
|
+
font_id = paragraph["pdf_style"]["font_id"]
|
|
52
|
+
if font_id in page_font_map:
|
|
53
|
+
fonts.add(page_font_map[font_id])
|
|
54
|
+
|
|
55
|
+
# Process paragraph compositions if present
|
|
56
|
+
if "pdf_paragraph_composition" in paragraph:
|
|
57
|
+
for comp in paragraph["pdf_paragraph_composition"]:
|
|
58
|
+
# Check different composition types that might contain font information
|
|
59
|
+
|
|
60
|
+
# Direct pdfCharacter in composition
|
|
61
|
+
if "pdf_character" in comp and comp["pdf_character"]:
|
|
62
|
+
char = comp["pdf_character"]
|
|
63
|
+
if "pdf_style" in char and "font_id" in char["pdf_style"]:
|
|
64
|
+
font_id = char["pdf_style"]["font_id"]
|
|
65
|
+
if font_id in page_font_map:
|
|
66
|
+
fonts.add(page_font_map[font_id])
|
|
67
|
+
|
|
68
|
+
# PdfLine in composition
|
|
69
|
+
elif "pdf_line" in comp and comp["pdf_line"]:
|
|
70
|
+
line = comp["pdf_line"]
|
|
71
|
+
if "pdf_character" in line:
|
|
72
|
+
for char in line["pdf_character"]:
|
|
73
|
+
if "pdf_style" in char and "font_id" in char["pdf_style"]:
|
|
74
|
+
font_id = char["pdf_style"]["font_id"]
|
|
75
|
+
if font_id in page_font_map:
|
|
76
|
+
fonts.add(page_font_map[font_id])
|
|
77
|
+
|
|
78
|
+
# PdfFormula in composition
|
|
79
|
+
elif "pdf_formula" in comp and comp["pdf_formula"]:
|
|
80
|
+
formula = comp["pdf_formula"]
|
|
81
|
+
if "pdf_character" in formula:
|
|
82
|
+
for char in formula["pdf_character"]:
|
|
83
|
+
if "pdf_style" in char and "font_id" in char["pdf_style"]:
|
|
84
|
+
font_id = char["pdf_style"]["font_id"]
|
|
85
|
+
if font_id in page_font_map:
|
|
86
|
+
fonts.add(page_font_map[font_id])
|
|
87
|
+
|
|
88
|
+
# PdfSameStyleCharacters in composition
|
|
89
|
+
elif (
|
|
90
|
+
"pdf_same_style_characters" in comp
|
|
91
|
+
and comp["pdf_same_style_characters"]
|
|
92
|
+
):
|
|
93
|
+
same_style = comp["pdf_same_style_characters"]
|
|
94
|
+
if "pdf_style" in same_style and "font_id" in same_style["pdf_style"]:
|
|
95
|
+
font_id = same_style["pdf_style"]["font_id"]
|
|
96
|
+
if font_id in page_font_map:
|
|
97
|
+
fonts.add(page_font_map[font_id])
|
|
98
|
+
|
|
99
|
+
# PdfSameStyleUnicodeCharacters in composition
|
|
100
|
+
elif (
|
|
101
|
+
"pdf_same_style_unicode_characters" in comp
|
|
102
|
+
and comp["pdf_same_style_unicode_characters"]
|
|
103
|
+
):
|
|
104
|
+
same_style_unicode = comp["pdf_same_style_unicode_characters"]
|
|
105
|
+
if (
|
|
106
|
+
"pdf_style" in same_style_unicode
|
|
107
|
+
and "font_id" in same_style_unicode["pdf_style"]
|
|
108
|
+
):
|
|
109
|
+
font_id = same_style_unicode["pdf_style"]["font_id"]
|
|
110
|
+
if font_id in page_font_map:
|
|
111
|
+
fonts.add(page_font_map[font_id])
|
|
112
|
+
|
|
113
|
+
return fonts
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def find_fonts_by_debug_id(json_path: Path, debug_id_regex: str) -> dict[str, str]:
|
|
117
|
+
"""
|
|
118
|
+
Find all fonts used in paragraphs with matching debug_id.
|
|
119
|
+
|
|
120
|
+
Args:
|
|
121
|
+
json_path: Path to the il_translated.json file
|
|
122
|
+
debug_id_regex: Regular expression to match debug_id values
|
|
123
|
+
|
|
124
|
+
Returns:
|
|
125
|
+
Dictionary mapping font_ids to font names
|
|
126
|
+
"""
|
|
127
|
+
# Load and parse JSON
|
|
128
|
+
with json_path.open("rb") as f:
|
|
129
|
+
doc_data = orjson.loads(f.read())
|
|
130
|
+
|
|
131
|
+
# Compile regex pattern (case insensitive)
|
|
132
|
+
pattern = re.compile(debug_id_regex.strip(" \"'"), re.IGNORECASE)
|
|
133
|
+
|
|
134
|
+
# Set to collect all found font information
|
|
135
|
+
found_fonts = set()
|
|
136
|
+
|
|
137
|
+
# Process each page
|
|
138
|
+
for page in doc_data.get("page", []):
|
|
139
|
+
# Create a mapping of font_id to (font_id, name) tuples for this page
|
|
140
|
+
page_font_map = {}
|
|
141
|
+
for font in page.get("pdf_font", []):
|
|
142
|
+
if "font_id" in font and "name" in font:
|
|
143
|
+
page_font_map[font["font_id"]] = (font["font_id"], font["name"])
|
|
144
|
+
|
|
145
|
+
# Check each paragraph
|
|
146
|
+
for paragraph in page.get("pdf_paragraph", []):
|
|
147
|
+
# Check if paragraph has debug_id and if it matches the pattern
|
|
148
|
+
debug_id = paragraph.get("debug_id")
|
|
149
|
+
if debug_id and pattern.search(debug_id):
|
|
150
|
+
# Get all fonts used in this paragraph
|
|
151
|
+
paragraph_fonts = extract_fonts_from_paragraph(paragraph, page_font_map)
|
|
152
|
+
found_fonts.update(paragraph_fonts)
|
|
153
|
+
|
|
154
|
+
# Convert set of tuples to dictionary
|
|
155
|
+
return dict(found_fonts)
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
def main():
|
|
159
|
+
parser = argparse.ArgumentParser(
|
|
160
|
+
description="Extract fonts from paragraphs with matching debug_id"
|
|
161
|
+
)
|
|
162
|
+
parser.add_argument(
|
|
163
|
+
"debug_id_regex", nargs="+", help="Regular expression to match debug_id values"
|
|
164
|
+
)
|
|
165
|
+
parser.add_argument(
|
|
166
|
+
"--json-path",
|
|
167
|
+
help="Path to il_translated.json (if not provided, will use the latest file)",
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
args = parser.parse_args()
|
|
171
|
+
|
|
172
|
+
# Determine JSON file path
|
|
173
|
+
json_path = None
|
|
174
|
+
if args.json_path:
|
|
175
|
+
json_path = Path(args.json_path)
|
|
176
|
+
if not json_path.exists():
|
|
177
|
+
print(f"Error: File not found: {json_path}")
|
|
178
|
+
return 1
|
|
179
|
+
else:
|
|
180
|
+
json_path = find_latest_il_json()
|
|
181
|
+
if not json_path:
|
|
182
|
+
print("Error: Could not find any il_translated.json file")
|
|
183
|
+
return 1
|
|
184
|
+
|
|
185
|
+
print(f"Using JSON file: {json_path}")
|
|
186
|
+
|
|
187
|
+
# Find fonts matching the debug_id pattern
|
|
188
|
+
fonts = find_fonts_by_debug_id(json_path, "|".join(args.debug_id_regex))
|
|
189
|
+
|
|
190
|
+
# Output the results
|
|
191
|
+
if fonts:
|
|
192
|
+
print(
|
|
193
|
+
f"Found {len(fonts)} fonts in paragraphs matching debug_id pattern: {args.debug_id_regex}"
|
|
194
|
+
)
|
|
195
|
+
print(json.dumps(fonts, indent=2, ensure_ascii=False))
|
|
196
|
+
else:
|
|
197
|
+
print(
|
|
198
|
+
f"No fonts found for paragraphs matching debug_id pattern: {args.debug_id_regex}"
|
|
199
|
+
)
|
|
200
|
+
|
|
201
|
+
return 0
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
if __name__ == "__main__":
|
|
205
|
+
exit(main())
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "BabelDOC"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.32"
|
|
4
4
|
description = "Yet Another Document Translator"
|
|
5
5
|
license = "AGPL-3.0"
|
|
6
6
|
readme = "README.md"
|
|
@@ -148,7 +148,7 @@ pythonpath = [".", "src"]
|
|
|
148
148
|
testpaths = ["tests"]
|
|
149
149
|
|
|
150
150
|
[bumpver]
|
|
151
|
-
current_version = "0.2.
|
|
151
|
+
current_version = "0.2.32"
|
|
152
152
|
version_pattern = "MAJOR.MINOR.PATCH[.PYTAGNUM]"
|
|
153
153
|
|
|
154
154
|
[bumpver.file_patterns]
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.2.31"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/document_il/babeldoc_exception/BabelDOCException.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{babeldoc-0.2.31 → babeldoc-0.2.32}/babeldoc/document_il/utils/priority_thread_pool_executor.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{babeldoc-0.2.31 → babeldoc-0.2.32}/docs/ImplementationDetails/AsyncTranslate/AsyncTranslate.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{babeldoc-0.2.31 → babeldoc-0.2.32}/docs/ImplementationDetails/ParagraphFinding/ParagraphFinding.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{babeldoc-0.2.31 → babeldoc-0.2.32}/docs/images/babeldoc-big-logo-with-transparent-background.png
RENAMED
|
File without changes
|
{babeldoc-0.2.31 → babeldoc-0.2.32}/docs/images/babeldoc-big-logo-with-transparent-background.svg
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{babeldoc-0.2.31 → babeldoc-0.2.32}/docs/images/babeldoc-small-logo-with-transparent-background.png
RENAMED
|
File without changes
|
{babeldoc-0.2.31 → babeldoc-0.2.32}/docs/images/babeldoc-small-logo-with-transparent-background.svg
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|