Skip to content

Commit 1a6a6e4

Browse files
committed
format
1 parent 229be5f commit 1a6a6e4

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

Diff for: add_import_names.py

+13-7
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,29 @@
55
Creates updated_drivers.rst which includes import names for each module.
66
"""
77

8-
if __name__ == '__main__':
9-
with open('docs/drivers.rst', 'r') as drivers_rst:
8+
if __name__ == "__main__":
9+
with open("docs/drivers.rst", "r") as drivers_rst:
1010
with open("updated_drivers.rst", "w") as updated_drivers_rst:
1111
lines = drivers_rst.readlines()
1212

1313
for line in lines:
1414

1515
if "<https://docs.circuitpython.org/" in line:
1616
docs_url = line.split("<")[1].split(">")[0]
17-
#print(docs_url)
17+
# print(docs_url)
1818

19-
short_name = line.split("https://docs.circuitpython.org/projects/")[1].split("/en/latest/")[0]
19+
short_name = line.split("https://docs.circuitpython.org/projects/")[
20+
1
21+
].split("/en/latest/")[0]
2022
insert_index = line.index("<") - 1
21-
#print(f"adafruit_{short_name} | {insert_index}")
23+
# print(f"adafruit_{short_name} | {insert_index}")
2224

23-
modified = line[:insert_index] + f" (adafruit_{short_name})" + line[insert_index:]
24-
#print(modified)
25+
modified = (
26+
line[:insert_index]
27+
+ f" (adafruit_{short_name})"
28+
+ line[insert_index:]
29+
)
30+
# print(modified)
2531
updated_drivers_rst.write(modified)
2632
else:
2733
updated_drivers_rst.write(line)

0 commit comments

Comments
 (0)