Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwurstsalat <mailtrash@posteo.de>2023-06-15 13:21:45 +0300
committerwurstsalat <mailtrash@posteo.de>2023-06-15 17:11:21 +0300
commit025c05bf8a3405131a2d9a67f6a4cf4c6e22af96 (patch)
tree8023b58885e010a9e5486287b2d15f88b55e4109
parentf67043e178b9b4b2d57d6d190e1fbef13234241c (diff)
cq: Settings: Improve type annotations
-rw-r--r--gajim/common/modules/contacts.py10
-rw-r--r--gajim/common/settings.py14
2 files changed, 12 insertions, 12 deletions
diff --git a/gajim/common/modules/contacts.py b/gajim/common/modules/contacts.py
index c92b798d4..6f6819232 100644
--- a/gajim/common/modules/contacts.py
+++ b/gajim/common/modules/contacts.py
@@ -68,9 +68,9 @@ class ContactSettings:
self._account, self._jid, setting)
@overload
- def set(self, setting: StringContactSettings, value: str) -> None: ... # noqa: E501, E704
+ def set(self, setting: StringContactSettings, value: str | None) -> None: ... # noqa: E501, E704
@overload
- def set(self, setting: BoolContactSettings, value: bool) -> None: ... # noqa: E501, E704
+ def set(self, setting: BoolContactSettings, value: bool | None) -> None: ... # noqa: E501, E704
def set(self, setting: Any, value: Any) -> None:
app.settings.set_contact_setting(
@@ -94,11 +94,11 @@ class GroupChatSettings:
self._account, self._jid, setting)
@overload
- def set(self, setting: StringGroupChatSettings, value: str) -> None: ... # noqa: E501, E704
+ def set(self, setting: StringGroupChatSettings, value: str | None) -> None: ... # noqa: E501, E704
@overload
- def set(self, setting: BoolGroupChatSettings, value: bool) -> None: ... # noqa: E501, E704
+ def set(self, setting: BoolGroupChatSettings, value: bool | None) -> None: ... # noqa: E501, E704
@overload
- def set(self, setting: IntGroupChatSettings, value: int) -> None: ... # noqa: E501, E704
+ def set(self, setting: IntGroupChatSettings, value: int | None) -> None: ... # noqa: E501, E704
def set(self, setting: Any, value: Any) -> None:
app.settings.set_group_chat_setting(
diff --git a/gajim/common/settings.py b/gajim/common/settings.py
index 129193800..bcf4abcbe 100644
--- a/gajim/common/settings.py
+++ b/gajim/common/settings.py
@@ -924,7 +924,7 @@ class Settings:
account: str,
jid: JID,
setting: StringGroupChatSettings,
- value: str) -> None:
+ value: str | None) -> None:
...
@overload
@@ -932,7 +932,7 @@ class Settings:
account: str,
jid: JID,
setting: IntGroupChatSettings,
- value: int) -> None:
+ value: int | None) -> None:
...
@overload
@@ -940,14 +940,14 @@ class Settings:
account: str,
jid: JID,
setting: BoolGroupChatSettings,
- value: bool) -> None:
+ value: bool | None) -> None:
...
def set_group_chat_setting(self,
account: str,
jid: JID,
setting: AllGroupChatSettings,
- value: AllGroupChatSettingsT) -> None:
+ value: AllGroupChatSettingsT | None) -> None:
if account not in self._account_settings:
raise ValueError(f'Account missing: {account}')
@@ -1059,7 +1059,7 @@ class Settings:
account: str,
jid: JID,
setting: StringContactSettings,
- value: str) -> None:
+ value: str | None) -> None:
...
@overload
@@ -1067,14 +1067,14 @@ class Settings:
account: str,
jid: JID,
setting: BoolContactSettings,
- value: bool) -> None:
+ value: bool | None) -> None:
...
def set_contact_setting(self,
account: str,
jid: JID,
setting: AllContactSettings,
- value: AllContactSettingsT) -> None:
+ value: AllContactSettingsT | None) -> None:
if account not in self._account_settings:
raise ValueError(f'Account missing: {account}')