Skip to content

Commit 1a62f04

Browse files
committed
Types export script: Clearer paths; Removed unused variable
1 parent 9988d0d commit 1a62f04

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

tools/ts_export_docs_controls.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
manual_dir = (
1414
Path(os.path.dirname(os.path.realpath(__file__))) / ".."
1515
).resolve()
16-
docname_to_parse = "chapters/appendix/mixxx_controls"
17-
output = manual_dir / "build" / "mixxx-controls.d.ts"
16+
doctree_to_parse = (
17+
manual_dir / "build/doctrees/chapters/appendix/mixxx_controls.doctree"
18+
)
19+
output = manual_dir / "build/mixxx-controls.d.ts"
1820

1921

2022
# ======================================
@@ -63,11 +65,7 @@ def from_node(node: addnodes.desc) -> "Control":
6365
)
6466

6567

66-
def read_doctree(doc_rel_path: str):
67-
doctree_path = (
68-
manual_dir / "build" / "doctrees" / f"{doc_rel_path}.doctree"
69-
)
70-
68+
def read_doctree(doctree_path: Path):
7169
with open(doctree_path, "rb") as f:
7270
doc = pickle.load(f)
7371
return doc
@@ -546,7 +544,7 @@ def export_ts_types(
546544

547545
if __name__ == "__main__":
548546
print("--- Read controls doctree ---")
549-
doc = read_doctree(docname_to_parse)
547+
doc = read_doctree(doctree_to_parse)
550548
pm_suffixes = read_pot_meter_suffixes(doc)
551549

552550
groups: list[Group] = read_group_info(doc)
@@ -571,5 +569,3 @@ def export_ts_types(
571569

572570
print(f"--- Generating {output} ---")
573571
export_ts_types(output, groups, controls, pm_suffixes)
574-
575-
prettierrc_path = Path("../mixxx/.prettierrc.yaml")

0 commit comments

Comments
 (0)