*: 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 -4
View File
@@ -5,7 +5,6 @@ import configparser
import os
import re
import subprocess
from typing import Optional
from plinth import action_utils
from plinth.actions import privileged
@@ -65,8 +64,8 @@ def _get_db_name():
@privileged
def set_configuration(enable_osm: Optional[bool] = None,
admin_user: Optional[str] = None):
def set_configuration(enable_osm: bool | None = None,
admin_user: str | None = None):
"""Setup Zoph Apache configuration."""
_zoph_configure('interface.user.remote', 'true')
@@ -90,7 +89,7 @@ def set_configuration(enable_osm: Optional[bool] = None,
@privileged
def is_configured() -> Optional[bool]:
def is_configured() -> bool | None:
"""Return whether zoph app is configured."""
try:
process = subprocess.run(