From 421a6c02a010c022075561d697acc96d4dc40c46 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 10 Sep 2023 18:10:38 +0200 Subject: [PATCH] Improve enum imports --- freqtrade/exchange/bybit.py | 3 +-- freqtrade/exchange/exchange.py | 3 +-- freqtrade/exchange/okx.py | 3 +-- freqtrade/freqtradebot.py | 5 ++--- freqtrade/rpc/api_server/ws_schemas.py | 2 +- freqtrade/util/binance_mig.py | 2 +- 6 files changed, 7 insertions(+), 11 deletions(-) diff --git a/freqtrade/exchange/bybit.py b/freqtrade/exchange/bybit.py index 41e667fb5..d9b7c817f 100644 --- a/freqtrade/exchange/bybit.py +++ b/freqtrade/exchange/bybit.py @@ -6,8 +6,7 @@ from typing import Any, Dict, List, Optional, Tuple import ccxt from freqtrade.constants import BuySell -from freqtrade.enums import MarginMode, PriceType, TradingMode -from freqtrade.enums.candletype import CandleType +from freqtrade.enums import CandleType, MarginMode, PriceType, TradingMode from freqtrade.exceptions import DDosProtection, OperationalException, TemporaryError from freqtrade.exchange import Exchange from freqtrade.exchange.common import retrier diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index 163e9a2a2..ddb00ecef 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -23,8 +23,7 @@ from freqtrade.constants import (DEFAULT_AMOUNT_RESERVE_PERCENT, NON_OPEN_EXCHAN BuySell, Config, EntryExit, ExchangeConfig, ListPairsWithTimeframes, MakerTaker, OBLiteral, PairWithTimeframe) from freqtrade.data.converter import clean_ohlcv_dataframe, ohlcv_to_dataframe, trades_dict_to_list -from freqtrade.enums import OPTIMIZE_MODES, CandleType, MarginMode, TradingMode -from freqtrade.enums.pricetype import PriceType +from freqtrade.enums import OPTIMIZE_MODES, CandleType, MarginMode, PriceType, TradingMode from freqtrade.exceptions import (DDosProtection, ExchangeError, InsufficientFundsError, InvalidOrderException, OperationalException, PricingError, RetryableOrderError, TemporaryError) diff --git a/freqtrade/exchange/okx.py b/freqtrade/exchange/okx.py index 7b1c90515..c0629240d 100644 --- a/freqtrade/exchange/okx.py +++ b/freqtrade/exchange/okx.py @@ -4,8 +4,7 @@ from typing import Any, Dict, List, Optional, Tuple import ccxt from freqtrade.constants import BuySell -from freqtrade.enums import CandleType, MarginMode, TradingMode -from freqtrade.enums.pricetype import PriceType +from freqtrade.enums import CandleType, MarginMode, PriceType, TradingMode from freqtrade.exceptions import (DDosProtection, OperationalException, RetryableOrderError, TemporaryError) from freqtrade.exchange import Exchange, date_minus_candles diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index 26bb95257..f66fe8feb 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -21,9 +21,8 @@ from freqtrade.enums import (ExitCheckTuple, ExitType, RPCMessageType, RunMode, State, TradingMode) from freqtrade.exceptions import (DependencyException, ExchangeError, InsufficientFundsError, InvalidOrderException, PricingError) -from freqtrade.exchange import (ROUND_DOWN, ROUND_UP, timeframe_to_minutes, timeframe_to_next_date, - timeframe_to_seconds) -from freqtrade.exchange.common import remove_exchange_credentials +from freqtrade.exchange import (ROUND_DOWN, ROUND_UP, remove_exchange_credentials, + timeframe_to_minutes, timeframe_to_next_date, timeframe_to_seconds) from freqtrade.misc import safe_value_fallback, safe_value_fallback2 from freqtrade.mixins import LoggingMixin from freqtrade.persistence import Order, PairLocks, Trade, init_db diff --git a/freqtrade/rpc/api_server/ws_schemas.py b/freqtrade/rpc/api_server/ws_schemas.py index 34eaf0245..970ea8cf8 100644 --- a/freqtrade/rpc/api_server/ws_schemas.py +++ b/freqtrade/rpc/api_server/ws_schemas.py @@ -5,7 +5,7 @@ from pandas import DataFrame from pydantic import BaseModel, ConfigDict from freqtrade.constants import PairWithTimeframe -from freqtrade.enums.rpcmessagetype import RPCMessageType, RPCRequestType +from freqtrade.enums import RPCMessageType, RPCRequestType class BaseArbitraryModel(BaseModel): diff --git a/freqtrade/util/binance_mig.py b/freqtrade/util/binance_mig.py index 7043459f2..cc9c451b2 100644 --- a/freqtrade/util/binance_mig.py +++ b/freqtrade/util/binance_mig.py @@ -4,7 +4,7 @@ from packaging import version from sqlalchemy import select from freqtrade.constants import DOCS_LINK, Config -from freqtrade.enums.tradingmode import TradingMode +from freqtrade.enums import TradingMode from freqtrade.exceptions import OperationalException from freqtrade.persistence.pairlock import PairLock from freqtrade.persistence.trade_model import Trade