Don't use relative imports

This commit is contained in:
Matthias 2021-01-01 19:13:32 +01:00
parent b2ab553a31
commit 718f2b24d2
2 changed files with 12 additions and 12 deletions

View File

@ -10,14 +10,15 @@ from freqtrade.constants import USERPATH_STRATEGIES
from freqtrade.data.history import get_datahandler from freqtrade.data.history import get_datahandler
from freqtrade.exceptions import OperationalException from freqtrade.exceptions import OperationalException
from freqtrade.rpc import RPC from freqtrade.rpc import RPC
from freqtrade.rpc.rpc import RPCException from freqtrade.rpc.api_server.api_models import (AvailablePairs, Balances, BlacklistPayload,
BlacklistResponse, Count, Daily, DeleteTrade,
from .api_models import (AvailablePairs, Balances, BlacklistPayload, BlacklistResponse, Count, ForceBuyPayload, ForceSellPayload, Locks, Logs,
Daily, DeleteTrade, ForceBuyPayload, ForceSellPayload, Locks, Logs, PairHistory, PerformanceEntry, Ping, PlotConfig,
PairHistory, PerformanceEntry, Ping, PlotConfig, Profit, ResultMsg, Stats, Profit, ResultMsg, Stats, StatusMsg,
StatusMsg, StrategyListResponse, StrategyResponse, Version, StrategyListResponse, StrategyResponse, Version,
WhitelistResponse) WhitelistResponse)
from .deps import get_config, get_rpc from freqtrade.rpc.api_server.deps import get_config, get_rpc
from freqtrade.rpc.rpc import RPCException
# Public API, requires no auth. # Public API, requires no auth.

View File

@ -7,10 +7,9 @@ from fastapi import Depends, FastAPI
from fastapi.middleware.cors import CORSMiddleware from fastapi.middleware.cors import CORSMiddleware
from starlette.responses import JSONResponse from starlette.responses import JSONResponse
from freqtrade.rpc.api_server.uvicorn_threaded import UvicornServer
from freqtrade.rpc.rpc import RPC, RPCException, RPCHandler from freqtrade.rpc.rpc import RPC, RPCException, RPCHandler
from .uvicorn_threaded import UvicornServer
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -54,9 +53,9 @@ class ApiServer(RPCHandler):
) )
def configure_app(self, app: FastAPI, config): def configure_app(self, app: FastAPI, config):
from .api_auth import http_basic_or_jwt_token, router_login from freqtrade.rpc.api_server.api_auth import http_basic_or_jwt_token, router_login
from .api_v1 import router as api_v1 from freqtrade.rpc.api_server.api_v1 import router as api_v1
from .api_v1 import router_public as api_v1_public from freqtrade.rpc.api_server.api_v1 import router_public as api_v1_public
app.include_router(api_v1_public, prefix="/api/v1") app.include_router(api_v1_public, prefix="/api/v1")
app.include_router(api_v1, prefix="/api/v1", app.include_router(api_v1, prefix="/api/v1",