rpc type hints

This commit is contained in:
xmatthias 2018-05-31 20:55:26 +02:00
parent 4733aad7ff
commit 0d251cbfdd
2 changed files with 5 additions and 4 deletions

View File

@ -1,6 +1,7 @@
"""
This module contains class to manage RPC communications (Telegram, Slack, ...)
"""
from typing import Any, Optional, List
import logging
from freqtrade.rpc.telegram import Telegram
@ -21,8 +22,8 @@ class RPCManager(object):
"""
self.freqtrade = freqtrade
self.registered_modules = []
self.telegram = None
self.registered_modules: List[str] = []
self.telegram: Any = None
self._init()
def _init(self) -> None:

View File

@ -18,7 +18,7 @@ from freqtrade.rpc.rpc import RPC
logger = logging.getLogger(__name__)
def authorized_only(command_handler: Callable[[Bot, Update], None]) -> Callable[..., Any]:
def authorized_only(command_handler: Callable[[Any, Bot, Update], None]) -> Callable[..., Any]:
"""
Decorator to check if the message comes from the correct chat_id
:param command_handler: Telegram CommandHandler
@ -65,7 +65,7 @@ class Telegram(RPC):
"""
super().__init__(freqtrade)
self._updater = None
self._updater: Updater = None
self._config = freqtrade.config
self._init()