Skip to content

Commit 2cbfebd

Browse files
style(pre-commit): auto fixes from pre-commit.com hooks
1 parent 5233bd1 commit 2cbfebd

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

scripts/docs_json_exporter.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
2-
import os
31
import json
2+
import os
3+
44
from bs4 import BeautifulSoup
55

6+
67
def log(msg):
78
print(f"::notice::{msg}")
89

10+
911
log("Starting docs JSON export...")
1012
folders = [
1113
"docs/_build/html/api",
@@ -35,10 +37,16 @@ def log(msg):
3537
if not class_name:
3638
class_name = dt.text.split(":")[-1].strip() if dt else None
3739
members = []
38-
for member_dl in class_dl.find_all("dl", class_=["attribute", "method"]):
40+
for member_dl in class_dl.find_all(
41+
"dl", class_=["attribute", "method"]
42+
):
3943
for member_dt in member_dl.find_all("dt"):
4044
member_id = member_dt.get("id")
41-
member_name = member_id.split(".")[-1] if member_id else member_dt.text.split(":")[-1].strip()
45+
member_name = (
46+
member_id.split(".")[-1]
47+
if member_id
48+
else member_dt.text.split(":")[-1].strip()
49+
)
4250
if member_name:
4351
members.append(member_name)
4452
page_index[class_name] = members
@@ -55,4 +63,4 @@ def log(msg):
5563
log("Exported docs to docs.json")
5664
log("To upload as artifact: docs.json")
5765
except Exception as e:
58-
print(f"::error::Docs JSON export failed: {e}")
66+
print(f"::error::Docs JSON export failed: {e}")

0 commit comments

Comments
 (0)