features: fix typing
for an annoying mypy bug
This commit is contained in:
parent
af958fd1fe
commit
35eafadb44
10 changed files with 38 additions and 26 deletions
|
@ -1,4 +1,3 @@
|
|||
|
||||
# Slixmpp: The Slick XMPP Library
|
||||
# Copyright (C) 2011 Nathanael C. Fritz
|
||||
# This file is part of Slixmpp.
|
||||
|
@ -11,6 +10,7 @@ from slixmpp.stanza import Iq, StreamFeatures
|
|||
from slixmpp.features.feature_bind import stanza
|
||||
from slixmpp.xmlstream import register_stanza_plugin
|
||||
from slixmpp.plugins import BasePlugin
|
||||
from typing import ClassVar, Set
|
||||
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
@ -20,7 +20,7 @@ class FeatureBind(BasePlugin):
|
|||
|
||||
name = 'feature_bind'
|
||||
description = 'RFC 6120: Stream Feature: Resource Binding'
|
||||
dependencies = set()
|
||||
dependencies: ClassVar[Set[str]] = set()
|
||||
stanza = stanza
|
||||
|
||||
def plugin_init(self):
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
# Slixmpp: The Slick XMPP Library
|
||||
# Copyright (C) 2011 Nathanael C. Fritz
|
||||
# This file is part of Slixmpp.
|
||||
|
@ -15,6 +14,8 @@ from slixmpp.xmlstream.matcher import MatchXPath
|
|||
from slixmpp.xmlstream.handler import Callback
|
||||
from slixmpp.features.feature_mechanisms import stanza
|
||||
|
||||
from typing import ClassVar, Set
|
||||
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
@ -23,7 +24,7 @@ class FeatureMechanisms(BasePlugin):
|
|||
|
||||
name = 'feature_mechanisms'
|
||||
description = 'RFC 6120: Stream Feature: SASL'
|
||||
dependencies = set()
|
||||
dependencies: ClassVar[Set[str]] = set()
|
||||
stanza = stanza
|
||||
default_config = {
|
||||
'use_mech': None,
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
|
||||
# Slixmpp: The Slick XMPP Library
|
||||
# Copyright (C) 2011 Nathanael C. Fritz
|
||||
# This file is part of Slixmpp.
|
||||
# See the file LICENSE for copying permission.
|
||||
from slixmpp.xmlstream import StanzaBase
|
||||
from typing import ClassVar, Set
|
||||
|
||||
|
||||
class Abort(StanzaBase):
|
||||
|
@ -13,7 +13,7 @@ class Abort(StanzaBase):
|
|||
|
||||
name = 'abort'
|
||||
namespace = 'urn:ietf:params:xml:ns:xmpp-sasl'
|
||||
interfaces = set()
|
||||
interfaces: ClassVar[Set[str]] = set()
|
||||
plugin_attrib = name
|
||||
|
||||
def setup(self, xml):
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
# Slixmpp: The Slick XMPP Library
|
||||
# Copyright (C) 2012 Nathanael C. Fritz
|
||||
# This file is part of Slixmpp.
|
||||
|
@ -9,6 +8,7 @@ from slixmpp.stanza import StreamFeatures
|
|||
from slixmpp.features.feature_preapproval import stanza
|
||||
from slixmpp.xmlstream import register_stanza_plugin
|
||||
from slixmpp.plugins.base import BasePlugin
|
||||
from typing import ClassVar, Set
|
||||
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
@ -18,7 +18,7 @@ class FeaturePreApproval(BasePlugin):
|
|||
|
||||
name = 'feature_preapproval'
|
||||
description = 'RFC 6121: Stream Feature: Subscription Pre-Approval'
|
||||
dependences = set()
|
||||
dependencies: ClassVar[Set[str]] = set()
|
||||
stanza = stanza
|
||||
|
||||
def plugin_init(self):
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
|
||||
# Slixmpp: The Slick XMPP Library
|
||||
# Copyright (C) 2012 Nathanael C. Fritz
|
||||
# This file is part of Slixmpp.
|
||||
# See the file LICENSE for copying permission.
|
||||
from slixmpp.xmlstream import ElementBase
|
||||
from typing import ClassVar, Set
|
||||
|
||||
|
||||
class PreApproval(ElementBase):
|
||||
|
||||
name = 'sub'
|
||||
namespace = 'urn:xmpp:features:pre-approval'
|
||||
interfaces = set()
|
||||
interfaces: ClassVar[Set[str]] = set()
|
||||
plugin_attrib = 'preapproval'
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
# Slixmpp: The Slick XMPP Library
|
||||
# Copyright (C) 2012 Nathanael C. Fritz
|
||||
# This file is part of Slixmpp.
|
||||
|
@ -9,6 +8,7 @@ from slixmpp.stanza import StreamFeatures
|
|||
from slixmpp.features.feature_rosterver import stanza
|
||||
from slixmpp.xmlstream import register_stanza_plugin
|
||||
from slixmpp.plugins.base import BasePlugin
|
||||
from typing import ClassVar, Set
|
||||
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
@ -18,7 +18,7 @@ class FeatureRosterVer(BasePlugin):
|
|||
|
||||
name = 'feature_rosterver'
|
||||
description = 'RFC 6121: Stream Feature: Roster Versioning'
|
||||
dependences = set()
|
||||
dependences: ClassVar[Set[str]] = set()
|
||||
stanza = stanza
|
||||
|
||||
def plugin_init(self):
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
|
||||
# Slixmpp: The Slick XMPP Library
|
||||
# Copyright (C) 2012 Nathanael C. Fritz
|
||||
# This file is part of Slixmpp.
|
||||
# See the file LICENSE for copying permission.
|
||||
from slixmpp.xmlstream import ElementBase
|
||||
from typing import Set, ClassVar
|
||||
|
||||
|
||||
class RosterVer(ElementBase):
|
||||
|
||||
name = 'ver'
|
||||
namespace = 'urn:xmpp:features:rosterver'
|
||||
interfaces = set()
|
||||
interfaces: ClassVar[Set[str]] = set()
|
||||
plugin_attrib = 'rosterver'
|
||||
|
|
|
@ -11,6 +11,7 @@ from slixmpp.xmlstream import register_stanza_plugin
|
|||
from slixmpp.plugins import BasePlugin
|
||||
|
||||
from slixmpp.features.feature_session import stanza
|
||||
from typing import ClassVar, Set
|
||||
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
@ -20,7 +21,7 @@ class FeatureSession(BasePlugin):
|
|||
|
||||
name = 'feature_session'
|
||||
description = 'RFC 3920: Stream Feature: Start Session'
|
||||
dependencies = set()
|
||||
dependencies: ClassVar[Set[str]] = set()
|
||||
stanza = stanza
|
||||
|
||||
def plugin_init(self):
|
||||
|
|
|
@ -4,39 +4,47 @@
|
|||
# This file is part of Slixmpp.
|
||||
# See the file LICENSE for copying permission.
|
||||
from slixmpp.xmlstream import StanzaBase, ElementBase
|
||||
from typing import Set, ClassVar
|
||||
|
||||
|
||||
class STARTTLS(StanzaBase):
|
||||
|
||||
"""
|
||||
"""
|
||||
|
||||
.. code-block:: xml
|
||||
|
||||
<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
|
||||
|
||||
"""
|
||||
name = 'starttls'
|
||||
namespace = 'urn:ietf:params:xml:ns:xmpp-tls'
|
||||
interfaces = {'required'}
|
||||
plugin_attrib = name
|
||||
|
||||
def get_required(self):
|
||||
"""
|
||||
"""
|
||||
return True
|
||||
|
||||
|
||||
class Proceed(StanzaBase):
|
||||
|
||||
"""
|
||||
"""
|
||||
|
||||
.. code-block:: xml
|
||||
|
||||
<proceed xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
|
||||
|
||||
"""
|
||||
name = 'proceed'
|
||||
namespace = 'urn:ietf:params:xml:ns:xmpp-tls'
|
||||
interfaces = set()
|
||||
interfaces: ClassVar[Set[str]] = set()
|
||||
|
||||
|
||||
class Failure(StanzaBase):
|
||||
|
||||
"""
|
||||
"""
|
||||
|
||||
.. code-block:: xml
|
||||
|
||||
<failure xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
|
||||
|
||||
"""
|
||||
name = 'failure'
|
||||
namespace = 'urn:ietf:params:xml:ns:xmpp-tls'
|
||||
interfaces = set()
|
||||
interfaces: ClassVar[Set[str]] = set()
|
||||
|
|
|
@ -12,6 +12,8 @@ from slixmpp.xmlstream.matcher import MatchXPath
|
|||
from slixmpp.xmlstream.handler import CoroutineCallback
|
||||
from slixmpp.features.feature_starttls import stanza
|
||||
|
||||
from typing import ClassVar, Set
|
||||
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
@ -20,7 +22,7 @@ class FeatureSTARTTLS(BasePlugin):
|
|||
|
||||
name = 'feature_starttls'
|
||||
description = 'RFC 6120: Stream Feature: STARTTLS'
|
||||
dependencies = set()
|
||||
dependencies: ClassVar[Set[str]] = set()
|
||||
stanza = stanza
|
||||
|
||||
def plugin_init(self):
|
||||
|
|
Loading…
Reference in a new issue