mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
*: 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:
1 parent
a86a86d605
commit
38ece87c6c
29 files changed
+116
-140
No files matched your search
@@ -7,7 +7,6 @@ import pathlib
|
||||
import random
|
||||
import string
|
||||
from shutil import move
|
||||
from typing import Union
|
||||
|
||||
from plinth import action_utils
|
||||
from plinth.actions import privileged
|
||||
@@ -64,7 +63,7 @@ def setup():
|
||||
|
||||
|
||||
@privileged
|
||||
def get_config() -> dict[str, Union[int, str]]:
|
||||
def get_config() -> dict[str, int | str]:
|
||||
"""Read and print Shadowsocks configuration."""
|
||||
config = open(SHADOWSOCKS_CONFIG_SYMLINK, 'r', encoding='utf-8').read()
|
||||
return json.loads(config)
|
||||
@@ -86,7 +85,7 @@ def _merge_config(config):
|
||||
|
||||
|
||||
@privileged
|
||||
def merge_config(config: dict[str, Union[int, str]]):
|
||||
def merge_config(config: dict[str, int | str]):
|
||||
"""Configure Shadowsocks Client."""
|
||||
_merge_config(config)
|
||||
|
||||
|
||||
Reference in new issue
Block a user