*: Utilize newer 3.10 syntax for type hints

Tests:

- mypy does not show any errors.

- Installing ejabberd app works. Privileged actions run fine.

- Unit tests work.

- No additional testing was done as type annotations don't have any effect at
runtime.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2023-09-25 20:03:34 -04:00
1 parent a86a86d605
commit 38ece87c6c
29 files changed
+116 -140

No files matched your search

+3 -6
View File
@@ -1,8 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""Configure Minetest server."""
from typing import Optional
import augeas
from plinth import action_utils
@@ -13,10 +11,9 @@ AUG_PATH = '/files' + CONFIG_FILE + '/.anon'
@privileged
def configure(max_players: Optional[int] = None,
enable_pvp: Optional[bool] = None,
creative_mode: Optional[bool] = None,
enable_damage: Optional[bool] = None):
def configure(max_players: int | None = None, enable_pvp: bool | None = None,
creative_mode: bool | None = None,
enable_damage: bool | None = None):
"""Update configuration file and restart daemon if necessary."""
aug = load_augeas()
if max_players is not None: