Replace some pointless occurances of arrow

This commit is contained in:
Matthias 2020-10-20 20:11:38 +02:00
parent 7a092271c5
commit adffd402ea
2 changed files with 3 additions and 4 deletions

View File

@ -1,9 +1,9 @@
import logging import logging
import sys import sys
from collections import defaultdict from collections import defaultdict
from datetime import datetime, timedelta
from typing import Any, Dict, List from typing import Any, Dict, List
import arrow
from freqtrade.configuration import TimeRange, setup_utils_configuration from freqtrade.configuration import TimeRange, setup_utils_configuration
from freqtrade.data.converter import convert_ohlcv_format, convert_trades_format from freqtrade.data.converter import convert_ohlcv_format, convert_trades_format
@ -29,7 +29,7 @@ def start_download_data(args: Dict[str, Any]) -> None:
"You can only specify one or the other.") "You can only specify one or the other.")
timerange = TimeRange() timerange = TimeRange()
if 'days' in config: if 'days' in config:
time_since = arrow.utcnow().shift(days=-config['days']).strftime("%Y%m%d") time_since = (datetime.now() - timedelta(days=config['days'])).strftime("%Y%m%d")
timerange = TimeRange.parse_timerange(f'{time_since}-') timerange = TimeRange.parse_timerange(f'{time_since}-')
if 'timerange' in config: if 'timerange' in config:

View File

@ -8,7 +8,6 @@ import logging
from datetime import datetime, timezone from datetime import datetime, timezone
from typing import Any, Dict, List, Optional, Tuple from typing import Any, Dict, List, Optional, Tuple
from arrow import Arrow
from pandas import DataFrame from pandas import DataFrame
from freqtrade.constants import ListPairsWithTimeframes, PairWithTimeframe from freqtrade.constants import ListPairsWithTimeframes, PairWithTimeframe
@ -38,7 +37,7 @@ class DataProvider:
:param timeframe: Timeframe to get data for :param timeframe: Timeframe to get data for
:param dataframe: analyzed dataframe :param dataframe: analyzed dataframe
""" """
self.__cached_pairs[(pair, timeframe)] = (dataframe, Arrow.utcnow().datetime) self.__cached_pairs[(pair, timeframe)] = (dataframe, datetime.now(timezone.utc))
def add_pairlisthandler(self, pairlists) -> None: def add_pairlisthandler(self, pairlists) -> None:
""" """