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,15 +10,16 @@ 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.api_server.api_models import (AvailablePairs, Balances, BlacklistPayload,
BlacklistResponse, Count, Daily, DeleteTrade,
ForceBuyPayload, ForceSellPayload, Locks, Logs,
PairHistory, PerformanceEntry, Ping, PlotConfig,
Profit, ResultMsg, Stats, StatusMsg,
StrategyListResponse, StrategyResponse, Version,
WhitelistResponse)
from freqtrade.rpc.api_server.deps import get_config, get_rpc
from freqtrade.rpc.rpc import RPCException from freqtrade.rpc.rpc import RPCException
from .api_models import (AvailablePairs, Balances, BlacklistPayload, BlacklistResponse, Count,
Daily, DeleteTrade, ForceBuyPayload, ForceSellPayload, Locks, Logs,
PairHistory, PerformanceEntry, Ping, PlotConfig, Profit, ResultMsg, Stats,
StatusMsg, StrategyListResponse, StrategyResponse, Version,
WhitelistResponse)
from .deps import get_config, get_rpc
# Public API, requires no auth. # Public API, requires no auth.
router_public = APIRouter() router_public = APIRouter()

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",