Skip to content

Commit 76f745e

Browse files
committed
feat: clean up code by removing unnecessary blank lines and improving formatting consistency across multiple files
1 parent 9dbc71d commit 76f745e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1876
-2152
lines changed

examples/cli_document_tester.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@ def main():
2424
if args.docx:
2525
od.compile("Main", export_format="docx")
2626

27+
2728
if __name__ == "__main__":
2829
main()

examples/docx_diagnostics/inspect_docx.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,18 @@ def functional_doc(dest_doc):
3333
fig_ref = doc.add_figure_with_caption(
3434
caption_text=f"Caption for figure in section {subsection_label}",
3535
use_chapter_numbers=True,
36-
image_path=str(THIS_DIR / "pdoc/00-main/images/31343C.png")
36+
image_path=str(THIS_DIR / "pdoc/00-main/images/31343C.png"),
3737
)
3838
print(f" Added Figure {section_num}-{subsection_num}")
3939

4040
# Add table
41-
table_data = [
42-
["Header 1", "Header 2"],
43-
[f"Data {subsection_label}.1", f"Data {subsection_label}.2"]
44-
]
41+
table_data = [["Header 1", "Header 2"], [f"Data {subsection_label}.1", f"Data {subsection_label}.2"]]
4542
tbl_ref = doc.add_table_with_caption(
4643
caption_text=f"Caption for table in section {subsection_label}",
4744
rows=2,
4845
cols=2,
4946
data=table_data,
50-
use_chapter_numbers=True
47+
use_chapter_numbers=True,
5148
)
5249
print(f" Added Table {section_num}-{subsection_num}")
5350

@@ -77,7 +74,7 @@ def non_functional_doc(source_doc_dir, dest_doc):
7774

7875
def main():
7976
tmp_path = THIS_DIR / "temp"
80-
pdoc_dir = THIS_DIR / 'pdoc'
77+
pdoc_dir = THIS_DIR / "pdoc"
8178

8279
# Ensure directory exists
8380
tmp_path.mkdir(parents=True, exist_ok=True)
@@ -210,8 +207,8 @@ def main():
210207
print("DETAILED FIELD INSTRUCTION ANALYSIS")
211208
print("=" * 80)
212209

213-
working_ref_targets = [cr.target_or_label for cr in cross_refs if cr.ref_type == 'REF']
214-
nonfunc_ref_targets = [cr.target_or_label for cr in cross_refs_n if cr.ref_type == 'REF']
210+
working_ref_targets = [cr.target_or_label for cr in cross_refs if cr.ref_type == "REF"]
211+
nonfunc_ref_targets = [cr.target_or_label for cr in cross_refs_n if cr.ref_type == "REF"]
215212

216213
print(f"\nWorking document REF targets ({len(working_ref_targets)}):")
217214
for target in working_ref_targets:
@@ -227,13 +224,13 @@ def main():
227224

228225
print(f"\nWorking: Figure-related bookmarks vs REF targets:")
229226
for bm in bookmarks:
230-
if bm.name and ('fig' in bm.name.lower() or 'Ref2' in bm.name or 'Ref551' in bm.name):
227+
if bm.name and ("fig" in bm.name.lower() or "Ref2" in bm.name or "Ref551" in bm.name):
231228
is_referenced = bm.name in working_ref_set
232229
print(f" {bm.name:30s} {'[X] REFERENCED' if is_referenced else '[ ] NOT REFERENCED'}")
233230

234231
print(f"\nNon-functional: Figure-related bookmarks vs REF targets:")
235232
for bm in bookmarks_n:
236-
if bm.name and 'fig' in bm.name.lower():
233+
if bm.name and "fig" in bm.name.lower():
237234
is_referenced = bm.name in nonfunc_ref_set
238235
print(f" {bm.name:30s} {'[X] REFERENCED' if is_referenced else '[ ] NOT REFERENCED'}")
239236

examples/other/test_frontend_monitoring.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Enhanced test script to demonstrate frontend connection tracking with multiple frontends.
33
This script shows how to query the number of connected frontends and their IDs.
44
"""
5+
56
from paradoc.frontend.ws_server import (
67
ensure_ws_server,
78
has_active_frontends,
@@ -10,6 +11,7 @@
1011
)
1112
import time
1213

14+
1315
def main():
1416
print("=== Enhanced Paradoc Frontend Tracking Demo ===\n")
1517

@@ -60,6 +62,6 @@ def main():
6062

6163
print("\n=== Demo Complete ===")
6264

65+
6366
if __name__ == "__main__":
6467
main()
65-

examples/other/test_frontend_tracking.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
"""
22
Test script to demonstrate frontend connection tracking and frontend_id support.
33
"""
4+
45
from paradoc.frontend.ws_server import (
56
ensure_ws_server,
67
has_active_frontends,
78
get_connected_frontends,
89
ping_ws_server,
910
)
1011

12+
1113
def main():
1214
print("=== Paradoc Frontend Connection Tracking Demo ===\n")
13-
15+
1416
# 1. Start the WebSocket server
1517
print("1. Starting WebSocket server...")
1618
server_started = ensure_ws_server(host="localhost", port=13579)
@@ -19,20 +21,20 @@ def main():
1921
else:
2022
print(" ✗ Failed to start server")
2123
return
22-
24+
2325
# 2. Check if server is responsive
2426
print("\n2. Pinging WebSocket server...")
2527
if ping_ws_server(host="localhost", port=13579):
2628
print(" ✓ Server is responsive")
2729
else:
2830
print(" ✗ Server not responding")
2931
return
30-
32+
3133
# 3. Check for active frontends
3234
print("\n3. Checking for active frontends...")
3335
if has_active_frontends(host="localhost", port=13579):
3436
print(" ✓ Frontends are connected")
35-
37+
3638
# 4. Get list of connected frontend IDs
3739
frontend_ids = get_connected_frontends(host="localhost", port=13579)
3840
print(f"\n4. Connected frontends ({len(frontend_ids)}):")
@@ -43,9 +45,9 @@ def main():
4345
print(" → Please open a Paradoc Reader frontend first")
4446
print(" → You can open it by running: pixi run -e frontend wdev")
4547
print(" → Or by opening the standalone HTML file")
46-
48+
4749
print("\n=== Demo Complete ===")
4850

51+
4952
if __name__ == "__main__":
5053
main()
51-

0 commit comments

Comments
 (0)