Commit 5bcabd48 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Fix typing hints

parent 2206288c
Pipeline #8332 passed with stages
in 7 minutes and 30 seconds
......@@ -38,6 +38,7 @@
from collections import defaultdict
import nbxmpp
from nbxmpp.idlequeue import IdleQueue
from gi.repository import Gdk
import gajim
......@@ -131,7 +132,7 @@ def __init__(self):
ZEROCONF_ACC_NAME = 'Local'
# These will be set in app.gui_interface.
idlequeue = None # type: nbxmpp.idlequeue.IdleQueue
idlequeue = cast(IdleQueue, None)
socks5queue = None
gupnp_igd = None
......
......@@ -15,8 +15,9 @@
# XEP-0145: Annotations
from typing import Any
from typing import Dict # pylint: disable=unused-import
from typing import Dict
from typing import Tuple
from typing import Optional
from nbxmpp.errors import StanzaError
from nbxmpp.errors import MalformedStanzaError
......@@ -37,7 +38,7 @@ class Annotations(BaseModule):
def __init__(self, con: ConnectionT) -> None:
BaseModule.__init__(self, con)
self._annotations = {} # type: Dict[str, AnnotationNote]
self._annotations: Dict[str, AnnotationNote] = {}
def request_annotations(self) -> None:
self._nbxmpp('Annotations').request_annotations(
......@@ -54,7 +55,7 @@ def _annotations_received(self, task: Any) -> None:
for note in annotations:
self._annotations[note.jid] = note
def get_note(self, jid: str) -> AnnotationNote:
def get_note(self, jid: str) -> Optional[AnnotationNote]:
return self._annotations.get(jid)
def set_note(self, note: AnnotationNote) -> None:
......
......@@ -12,9 +12,9 @@
# You should have received a copy of the GNU General Public License
# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
from typing import Any # pylint: disable=unused-import
from typing import Dict # pylint: disable=unused-import
from typing import List # pylint: disable=unused-import
from typing import Any
from typing import Dict
from typing import List
import logging
from functools import partial
......@@ -38,9 +38,9 @@ def __init__(self, con, *args, plugin=False, **kwargs):
self._con = con
self._account = con.name
self._log = self._set_logger(plugin)
self._nbxmpp_callbacks = {} # type: Dict[str, Any]
self._nbxmpp_callbacks: Dict[str, Any] = {}
self._stored_publish = None # type: Callable
self.handlers = [] # type: List[str]
self.handlers: List[StanzaHandler] = []
def _set_logger(self, plugin):
logger_name = 'gajim.c.m.%s'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment