type anotation fixes

This commit is contained in:
xmatthias 2018-05-30 22:38:09 +02:00
parent 88755fcded
commit 45909af7e0
4 changed files with 10 additions and 8 deletions

View File

@ -5,7 +5,7 @@ This module contains the configuration class
import json
import logging
from argparse import Namespace
from typing import Dict, Any
from typing import Optional, Dict, Any
from jsonschema import Draft4Validator, validate
from jsonschema.exceptions import ValidationError, best_match
import ccxt
@ -23,7 +23,7 @@ class Configuration(object):
"""
def __init__(self, args: Namespace) -> None:
self.args = args
self.config = None
self.config: Optional[Dict[str, Any]] = None
def load_config(self) -> Dict[str, Any]:
"""
@ -192,7 +192,7 @@ class Configuration(object):
validate(conf, constants.CONF_SCHEMA)
return conf
except ValidationError as exception:
logger.fatal(
logger.critical(
'Invalid configuration. See config.json.example. Reason: %s',
exception
)

View File

@ -83,7 +83,7 @@ def file_dump_json(filename, data, is_zip=False) -> None:
json.dump(data, fp, default=str)
def format_ms_time(date: str) -> str:
def format_ms_time(date: int) -> str:
"""
convert MS date to readable format.
: epoch-string in ms

View File

@ -4,8 +4,8 @@ import gzip
import json
import logging
import os
from typing import Optional, List, Dict, Tuple, Any
import arrow
from typing import Optional, List, Dict, Tuple
from freqtrade import misc, constants
from freqtrade.exchange import get_ticker_history
@ -139,7 +139,9 @@ def download_pairs(datadir, pairs: List[str],
def load_cached_data_for_updating(filename: str,
tick_interval: str,
timerange: Optional[Tuple[Tuple, int, int]]) -> Tuple[list, int]:
timerange: Optional[Tuple[Tuple, int, int]]) -> Tuple[
List[Any],
Optional[int]]:
"""
Load cached data and choose what part of the data should be updated
"""

View File

@ -5,7 +5,7 @@ This module contains the class to persist trades into SQLite
import logging
from datetime import datetime
from decimal import Decimal, getcontext
from typing import Dict, Optional
from typing import Dict, Optional, Any
import arrow
from sqlalchemy import (Boolean, Column, DateTime, Float, Integer, String,
@ -21,7 +21,7 @@ from sqlalchemy import inspect
logger = logging.getLogger(__name__)
_CONF = {}
_DECL_BASE = declarative_base()
_DECL_BASE = declarative_base() # type: Any
def init(config: dict, engine: Optional[Engine] = None) -> None: