Skip to content

Commit 6d3c8d8

Browse files
author
Bernhard Kaindl
committed
docs: generate docs/profile_settings.rst intead of options.rst
- Use docs/profile_settings.rst instead of docs/options.rst
1 parent f4c693a commit 6d3c8d8

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ of `NetworkManager <https://wiki.gnome.org/Projects/NetworkManager>`_.
1212
examples
1313
device_interfaces
1414
other_interfaces
15-
options
15+
profile_settings
1616
enums
1717
exceptions
1818

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
Network Manager settings
2-
========================
1+
Connection Profile Settings Helpers
2+
===================================
3+
34

45
.. autoclass:: sdbus_async.networkmanager.settings.ConnectionSettings
56
:members:

tools/generate-settings-dataclasses.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -219,21 +219,22 @@ def find_first_not_none(itr: List[Any]) -> Optional[Any]:
219219

220220
# Generate docs/options.rst, see:
221221
# https://github.com/python-sdbus/python-sdbus-networkmanager/pull/39#issuecomment-1186522147
222-
def open_options_rst() -> io.TextIOWrapper:
223-
options_rst = open("docs/options.rst", "w")
224-
options_rst.write("Network Manager settings\n========================\n")
225-
return options_rst
222+
def open_profile_settings_rst() -> io.TextIOWrapper:
223+
profile_settings_rst = open("docs/profile_settings.rst", "w")
224+
profile_settings_rst.write("Connection Profile Settings Helpers\n")
225+
profile_settings_rst.write("===================================\n\n")
226+
return profile_settings_rst
226227

227228

228-
def append_sphinx_autoclass(options_rst: io.TextIOWrapper, classname: str) -> None:
229+
def append_sphinx_autoclass(profile_settings: io.TextIOWrapper, classname: str) -> None:
229230
classpath = f"sdbus_async.networkmanager.settings.{classname}"
230-
options_rst.write(f"\n.. autoclass:: {classpath}\n :members:\n")
231+
profile_settings.write(f"\n.. autoclass:: {classpath}\n :members:\n")
231232

232233

233234
# The code quality of this function is poor(Sourcery says 5%), needs refactoring,
234235
# also see the rework in tools/generate-settings-dataclasses-jinja.py
235236
def main(settings_xml_path: Path) -> None:
236-
options_rst = open_options_rst()
237+
profile_settings_rst = open_profile_settings_rst()
237238
gl_input_files = [settings_xml_path]
238239

239240
xml_roots = [ElementTree.parse(f).getroot() for f in gl_input_files]
@@ -315,7 +316,7 @@ def main(settings_xml_path: Path) -> None:
315316
p.write(" )\n")
316317
f.write("@dataclass\n")
317318
f.write(f"class {classname}(NetworkManagerSettingsMixin):\n")
318-
append_sphinx_autoclass(options_rst, classname)
319+
append_sphinx_autoclass(profile_settings_rst, classname)
319320

320321
# generate the docstring of the new settings_class
321322
desc = node_get_attr(settings, "description")

0 commit comments

Comments
 (0)