Skip to content

Commit 5c3f416

Browse files
authored
improve(docs:) cleaning up docstrings and admonitions (#767)
2 parents b534460 + 0769d77 commit 5c3f416

File tree

10 files changed

+34
-37
lines changed

10 files changed

+34
-37
lines changed

docs/guides/howto_behind_proxy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# How to use behind a network proxy
22

3-
:::{info}
3+
:::{note}
44
Only HTTP and HTTPS proxies are supported. No socks. Automatic values definition from PAC file available.
55
:::
66

docs/guides/howto_check_qdt_binary_certificate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ A security warning may appear for self-signed certificates; confirm by clicking
104104

105105
### Automate import with a PowerShell script
106106

107-
:::{info}
107+
:::{important}
108108
This script is a sample and might not comply with your environment and/or IT policy. If you intend to use it in production, take time to review it before. If you improve or fix it, please share it.
109109
:::
110110

docs/guides/howto_download_latest_qdt_exe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ QDT comes with an upgrade command that check if a new version has been released
44

55
Sometimes a system script fits better to usage, use-case or IT policy. We give below an example in PowerShell for Windows.
66

7-
:::{info}
7+
:::{important}
88
This script is a sample and might not comply with your environment and/or IT policy. If you intend to use it in production, take time to review it before. If you improve or fix it, please share it.
99
:::
1010

docs/guides/howto_manage_private_git.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ flowchart LR
2727

2828
To execute the intermediate git pull, the approach depends on the organization and GIS team habits. This can be done manually through the command-line, with a GUI like the excellent [GitHub Desktop](https://github.com/apps/desktop) or with a script. Below is an example PowerShell script for Windows.
2929

30-
:::{info}
30+
:::{attention}
3131
This script is provided as a sample and may not fully comply with your environment or IT policies. Before implementing in production, take time to review and test it in your environment. If you make improvements or fixes, please share them.
3232
:::
3333

docs/index.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ usage/settings
188188
```{toctree}
189189
---
190190
caption: Guides
191-
glob:
192191
maxdepth: 1
193192
---
194193
guides/howto_download_latest_qdt_exe.md
@@ -201,7 +200,6 @@ guides/howto_publish_http
201200
guides/howto_qgis_get_plugin_id
202201
guides/howto_schedule_deployment
203202
guides/howto_windows_sign_executable
204-
guides/*
205203
```
206204

207205
```{toctree}

qgis_deployment_toolbelt/jobs/job_profiles_synchronizer.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#! python3 # noqa: E265
22

3-
"""
4-
Synchronize profiles between downloaded (in QDT working folder) and installed
3+
"""Synchronize profiles between downloaded (in QDT working folder) and installed
54
profiles (in QGIS profiles'folder).
65
76
Author: Julien Moura (https://github.com/guts)
@@ -108,10 +107,10 @@ def compare_downloaded_with_installed_profiles(
108107
Returns:
109108
tuple[list[QdtProfile], list[QdtProfile], list[QdtProfile]]: a tuple with
110109
the following structure (
111-
list of installed profiles which are outdated (lesser version number),
112-
list of installed profiles with a different version (lesser or greater),
113-
list of profiles with the same version number in downloaded/installed
114-
)
110+
list of installed profiles and outdated (lesser version number),
111+
list of installed profiles with a different version (lesser or greater),
112+
list of profiles with the same version number in downloaded/installed
113+
)
115114
"""
116115
li_profiles_outdated = []
117116
li_profiles_different = []

qgis_deployment_toolbelt/jobs/job_shortcuts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def __init__(self, options: dict) -> None:
105105
"""Instantiate the class.
106106
107107
:param dict options: profiles source (remote, can be a local network) and
108-
destination (local).
108+
destination (local).
109109
"""
110110
super().__init__()
111111
self.options: dict = self.validate_options(options)

qgis_deployment_toolbelt/profiles/qgis_ini_handler.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
#! python3 # noqa: E265
1+
#! python3
22

3-
"""
4-
Read and write QGIS configuration files.
3+
"""Read and write QGIS configuration files.
54
65
Author: Julien Moura (https://github.com/guts)
76
"""
@@ -64,14 +63,14 @@ def __init__(
6463
6564
Args:
6665
ini_filepath (Path): path to the QGIS3.ini configuration file
67-
ini_type (Literal[ "profile_qgis3", \
68-
"profile_qgis3customization", "plugin_metadata", \
69-
None ], optional): type of ini file. None enables autodetection. \
70-
Defaults to None.
71-
strict (bool, optional): strict mode applied to ConfigParser. Defaults to \
66+
ini_type (Literal['profile_qgis3', 'profile_qgis3customization',\
67+
'plugin_metadata', None ], optional): type of ini file.\
68+
None enables autodetection. Defaults to None.
69+
strict (bool, optional): strict mode applied to ConfigParser. Defaults to
7270
False.
73-
enable_environment_variables_interpolation (bool, optional): if enabled, \
71+
enable_environment_variables_interpolation (bool, optional): if enabled,
7472
values matching environment variables are interepreted. Defaults to True.
73+
7574
"""
7675
if (
7776
ini_filepath is not None

qgis_deployment_toolbelt/utils/linux_utils.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
#! python3 # noqa: E265
22

3-
"""
4-
Utilities specific for Linux.
3+
"""Utilities specific for Linux.
54
65
Author: Julien Moura (https://github.com/guts)
7-
86
"""
97

108
# #############################################################################
@@ -98,7 +96,8 @@ def find_key_from_values(value_to_find: str) -> str | None:
9896

9997

10098
def get_environment_variable(envvar_name: str, scope: str = "user") -> str | None:
101-
"""Get environment variable from Linux profile file
99+
"""Get environment variable from Linux profile file.
100+
102101
Args:
103102
envvar_name (str): environment variable name (= key) to retrieve
104103
scope (str, optional): environment variable scope. Must be "user" or "system",
@@ -134,7 +133,8 @@ def get_environment_variable(envvar_name: str, scope: str = "user") -> str | Non
134133
def set_environment_variable(
135134
envvar_name: str, envvar_value: str | bool | int, scope: str = "user"
136135
) -> bool:
137-
"""Set environment variable in Linux profile file
136+
"""Set environment variable in Linux profile file.
137+
138138
Args:
139139
envvar_name (str): environment variable name (= key) to set
140140
envvar_value (str): environment variable value to set
@@ -225,7 +225,8 @@ def set_environment_variable(
225225
def delete_environment_variable(
226226
envvar_name: str, scope: Literal["system", "user"] = "user"
227227
) -> bool:
228-
"""Remove environment variable from Linux profile file
228+
"""Remove environment variable from Linux profile file.
229+
229230
Args:
230231
envvar_name (str): environment variable name (= key) to remove
231232
scope (str, optional): environment variable scope. Must be "user" or "system",
@@ -316,7 +317,8 @@ def refresh_environment() -> bool:
316317

317318

318319
def get_profile_file(scope: Literal["system", "user"]) -> Path | None:
319-
"""Get Linux profile file depending on shell and scope
320+
"""Get Linux profile file depending on shell and scope.
321+
320322
Args:
321323
scope (str, optional): environment variable scope. Must be "user" or "system",
322324
defaults to "user". Defaults to "user".

qgis_deployment_toolbelt/utils/user_groups.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#! python3 # noqa: E265
22

3-
"""
4-
Utilities to manage user security groups either on Linux and Windows.
3+
"""Utilities to manage user security groups either on Linux and Windows.
54
65
Author: Julien Moura (https://github.com/guts)
76
"""
@@ -143,9 +142,9 @@ def get_user_local_groups(user_name: str | None = None) -> list[str]:
143142
def get_user_domain_groups(user_guid_or_name: str | None = None) -> list[str]:
144143
"""Lists the domain groups to which the user belong.
145144
146-
On Linux and MacOS, it always return an empty list. TODO: implement it (probably
147-
using pure LDAP).
148-
On Windows, it relies on win32net (COM).
145+
On Linux and MacOS, it always return an empty list. On Windows, it relies on win32net (COM).
146+
147+
TODO: implement it for Linux and MacOS (probably using pure LDAP).
149148
150149
Args:
151150
user_guid_or_name (str | None, optional): name of user. If None, the current user name
@@ -272,9 +271,9 @@ def _is_computer_in_domain_win32() -> bool:
272271
def is_computer_attached_to_a_domain() -> bool:
273272
"""Determine if the computer is attached to a domain or not.
274273
275-
On Linux and MacOS, it always return False.
276-
On Windows, it tries to use wmi (Windows Management Instrumentation), Active
277-
Directory (through pyad) or subprocessed powershell as final fallback.
274+
On Linux and MacOS, it always return False. On Windows, it tries to use wmi
275+
(Windows Management Instrumentation), Active Directory (through pyad) or
276+
subprocessed powershell as final fallback.
278277
279278
Raises:
280279
NotImplementedError: if operating system is not supported.

0 commit comments

Comments
 (0)