summaryrefslogtreecommitdiff
path: root/slixmpp/stanza/stream_error.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2021-07-15 10:01:03 +0200
committermathieui <mathieui@mathieui.net>2021-07-15 10:01:03 +0200
commit22fa8bc4d91d38a1176b09d03e0d41313b1adcaa (patch)
tree7344f9e7d72b913e9dfef29fe9b926364e7db587 /slixmpp/stanza/stream_error.py
parentb1411d8ed79792c6839f4aace13061256337e69b (diff)
parent5c54806578260adcb54b12b00a16cc8707a19263 (diff)
downloadslixmpp-22fa8bc4d91d38a1176b09d03e0d41313b1adcaa.tar.gz
slixmpp-22fa8bc4d91d38a1176b09d03e0d41313b1adcaa.tar.bz2
slixmpp-22fa8bc4d91d38a1176b09d03e0d41313b1adcaa.tar.xz
slixmpp-22fa8bc4d91d38a1176b09d03e0d41313b1adcaa.zip
Merge branch 'more-typing' into 'master'
Add more typing See merge request poezio/slixmpp!166
Diffstat (limited to 'slixmpp/stanza/stream_error.py')
-rw-r--r--slixmpp/stanza/stream_error.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/slixmpp/stanza/stream_error.py b/slixmpp/stanza/stream_error.py
index 0e728c8e..d0eadd5b 100644
--- a/slixmpp/stanza/stream_error.py
+++ b/slixmpp/stanza/stream_error.py
@@ -4,7 +4,8 @@
# This file is part of Slixmpp.
# See the file LICENSE for copying permission.
from slixmpp.stanza.error import Error
-from slixmpp.xmlstream import StanzaBase
+from slixmpp.xmlstream import StanzaBase, ET
+from typing import Optional, Dict, Union
class StreamError(Error, StanzaBase):
@@ -62,19 +63,20 @@ class StreamError(Error, StanzaBase):
'system-shutdown', 'undefined-condition', 'unsupported-encoding',
'unsupported-feature', 'unsupported-stanza-type',
'unsupported-version'}
- condition_ns = 'urn:ietf:params:xml:ns:xmpp-streams'
+ condition_ns: str = 'urn:ietf:params:xml:ns:xmpp-streams'
- def get_see_other_host(self):
+ def get_see_other_host(self) -> Union[str, Dict[str, str]]:
ns = self.condition_ns
return self._get_sub_text('{%s}see-other-host' % ns, '')
- def set_see_other_host(self, value):
+ def set_see_other_host(self, value: str) -> Optional[ET.Element]:
if value:
del self['condition']
ns = self.condition_ns
return self._set_sub_text('{%s}see-other-host' % ns, value)
elif self['condition'] == 'see-other-host':
del self['condition']
+ return None
- def del_see_other_host(self):
+ def del_see_other_host(self) -> None:
self._del_sub('{%s}see-other-host' % self.condition_ns)