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
@@ -1,8 +1,6 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
"""Configure I2P."""
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from plinth.actions import privileged
|
||||
from plinth.modules.i2p.helpers import RouterEditor, TunnelEditor
|
||||
|
||||
@@ -19,8 +17,8 @@ def set_tunnel_property(name: str, property_: str, value: str):
|
||||
|
||||
|
||||
@privileged
|
||||
def add_favorite(name: str, url: str, description: Optional[str],
|
||||
icon: Optional[str]):
|
||||
def add_favorite(name: str, url: str, description: str | None,
|
||||
icon: str | None):
|
||||
"""Add a favorite to router.config."""
|
||||
editor = RouterEditor()
|
||||
editor.read_conf().add_favorite(name, url, description, icon).write_conf()
|
||||
Reference in new issue
Block a user