mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-19 06:44:22 +01:00
Apply refactoring to some relative import directives.
This commit is contained in:
@@ -2,11 +2,11 @@ from typing import Dict, List, Tuple, Union, Literal, Optional
|
||||
from decimal import Decimal
|
||||
from datetime import datetime
|
||||
|
||||
from .. middleware import Middleware
|
||||
from ..middleware import Middleware
|
||||
|
||||
from .. enums import Sort, OrderType, FundingOfferType
|
||||
from ..enums import Sort, OrderType, FundingOfferType
|
||||
|
||||
from ... types import JSON, Notification, \
|
||||
from ...types import JSON, Notification, \
|
||||
UserInfo, LoginHistory, BalanceAvailable, \
|
||||
Order, Position, Trade, \
|
||||
FundingTrade, OrderTrade, Ledger, \
|
||||
@@ -18,9 +18,9 @@ from ... types import JSON, Notification, \
|
||||
PositionIncrease, PositionHistory, PositionSnapshot, \
|
||||
PositionAudit, DerivativePositionCollateral, DerivativePositionCollateralLimits
|
||||
|
||||
from ... types import serializers
|
||||
from ...types import serializers
|
||||
|
||||
from ... types.serializers import _Notification
|
||||
from ...types.serializers import _Notification
|
||||
|
||||
class RestAuthenticatedEndpoints(Middleware):
|
||||
def get_user_info(self) -> UserInfo:
|
||||
|
||||
@@ -5,11 +5,11 @@ from typing import Callable, TypeVar, cast, \
|
||||
|
||||
from decimal import Decimal
|
||||
|
||||
from .. middleware import Middleware
|
||||
from ..middleware import Middleware
|
||||
|
||||
from .. enums import MerchantSettingsKey
|
||||
from ..enums import MerchantSettingsKey
|
||||
|
||||
from ... types import \
|
||||
from ...types import \
|
||||
InvoiceSubmission, InvoicePage, InvoiceStats, \
|
||||
CurrencyConversion, MerchantDeposit, MerchantUnlinkedDeposit
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@ from typing import List, Dict, Union, Literal, Optional, Any, cast
|
||||
|
||||
from decimal import Decimal
|
||||
|
||||
from .. middleware import Middleware
|
||||
from ..middleware import Middleware
|
||||
|
||||
from .. enums import Config, Sort
|
||||
from ..enums import Config, Sort
|
||||
|
||||
from ... types import \
|
||||
from ...types import \
|
||||
PlatformStatus, TradingPairTicker, FundingCurrencyTicker, \
|
||||
TickersHistory, TradingPairTrade, FundingCurrencyTrade, \
|
||||
TradingPairBook, FundingCurrencyBook, TradingPairRawBook, \
|
||||
@@ -15,7 +15,7 @@ from ... types import \
|
||||
FundingStatistic, PulseProfile, PulseMessage, \
|
||||
TradingMarketAveragePrice, FundingMarketAveragePrice, FxRate
|
||||
|
||||
from ... types import serializers
|
||||
from ...types import serializers
|
||||
|
||||
class RestPublicEndpoints(Middleware):
|
||||
def conf(self, config: Config) -> Any:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from .. exceptions import BfxBaseException
|
||||
from ..exceptions import BfxBaseException
|
||||
|
||||
__all__ = [
|
||||
"BfxRestException",
|
||||
|
||||
@@ -4,7 +4,7 @@ from typing import Optional
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
from .. types.labeler import _Type, generate_labeler_serializer, generate_recursive_serializer
|
||||
from ..types.labeler import _Type, generate_labeler_serializer, generate_recursive_serializer
|
||||
|
||||
class TestTypesLabeler(unittest.TestCase):
|
||||
def test_generate_labeler_serializer(self):
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import unittest
|
||||
|
||||
from dataclasses import dataclass
|
||||
from .. types.labeler import generate_labeler_serializer
|
||||
from .. types.notification import _Type, _Notification, Notification
|
||||
from ..types.labeler import generate_labeler_serializer
|
||||
from ..types.notification import _Type, _Notification, Notification
|
||||
|
||||
class TestTypesNotification(unittest.TestCase):
|
||||
def test_types_notification(self):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import unittest
|
||||
from .. types import serializers
|
||||
from .. types.labeler import _Type
|
||||
from ..types import serializers
|
||||
from ..types.labeler import _Type
|
||||
|
||||
class TestTypesSerializers(unittest.TestCase):
|
||||
def test_types_serializers(self):
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from . dataclasses import JSON, \
|
||||
from .dataclasses import JSON, \
|
||||
PlatformStatus, TradingPairTicker, FundingCurrencyTicker, \
|
||||
TickersHistory, TradingPairTrade, FundingCurrencyTrade, \
|
||||
TradingPairBook, FundingCurrencyBook, TradingPairRawBook, \
|
||||
@@ -7,7 +7,7 @@ from . dataclasses import JSON, \
|
||||
FundingStatistic, PulseProfile, PulseMessage, \
|
||||
TradingMarketAveragePrice, FundingMarketAveragePrice, FxRate
|
||||
|
||||
from . dataclasses import \
|
||||
from .dataclasses import \
|
||||
UserInfo, LoginHistory, BalanceAvailable, \
|
||||
Order, Position, Trade, \
|
||||
FundingTrade, OrderTrade, Ledger, \
|
||||
@@ -19,8 +19,8 @@ from . dataclasses import \
|
||||
PositionIncrease, PositionHistory, PositionSnapshot, \
|
||||
PositionAudit, DerivativePositionCollateral, DerivativePositionCollateralLimits
|
||||
|
||||
from . dataclasses import \
|
||||
from .dataclasses import \
|
||||
InvoiceSubmission, InvoicePage, InvoiceStats, \
|
||||
CurrencyConversion, MerchantDeposit, MerchantUnlinkedDeposit
|
||||
|
||||
from . notification import Notification
|
||||
from .notification import Notification
|
||||
|
||||
@@ -3,7 +3,7 @@ from typing import Union, Type, \
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
from . labeler import _Type, partial, compose
|
||||
from .labeler import _Type, partial, compose
|
||||
|
||||
JSON = Union[Dict[str, "JSON"], List["JSON"], bool, int, float, str, Type[None]]
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from typing import List, Optional, Any, Generic, TypeVar, cast
|
||||
from dataclasses import dataclass
|
||||
from . labeler import _Type, _Serializer
|
||||
from .labeler import _Type, _Serializer
|
||||
|
||||
T = TypeVar("T")
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
from . import dataclasses
|
||||
from .import dataclasses
|
||||
|
||||
from . labeler import \
|
||||
from .labeler import \
|
||||
generate_labeler_serializer, generate_recursive_serializer
|
||||
|
||||
#pylint: disable-next=unused-import
|
||||
from . notification import _Notification
|
||||
from .notification import _Notification
|
||||
|
||||
__serializers__ = [
|
||||
"PlatformStatus", "TradingPairTicker", "FundingCurrencyTicker",
|
||||
|
||||
@@ -2,8 +2,8 @@ from decimal import Decimal
|
||||
from datetime import datetime
|
||||
|
||||
from typing import Union, Optional, List, Tuple
|
||||
from .. enums import OrderType, FundingOfferType
|
||||
from ... types import JSON
|
||||
from ..enums import OrderType, FundingOfferType
|
||||
from ...types import JSON
|
||||
|
||||
class BfxWebSocketInputs:
|
||||
def __init__(self, handle_websocket_input):
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#pylint: disable-next=wildcard-import,unused-wildcard-import
|
||||
from .. enums import *
|
||||
from ..enums import *
|
||||
|
||||
class Channel(str, Enum):
|
||||
TICKER = "ticker"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from .. exceptions import BfxBaseException
|
||||
from ..exceptions import BfxBaseException
|
||||
|
||||
__all__ = [
|
||||
"BfxWebSocketException",
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from .. exceptions import HandlerNotFound
|
||||
from ..exceptions import HandlerNotFound
|
||||
|
||||
from ... types import serializers
|
||||
from ...types import serializers
|
||||
|
||||
from ... types.serializers import _Notification
|
||||
from ...types.serializers import _Notification
|
||||
|
||||
class AuthenticatedEventsHandler:
|
||||
__once_abbreviations = {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from .. exceptions import HandlerNotFound
|
||||
from ..exceptions import HandlerNotFound
|
||||
|
||||
from ... types import serializers
|
||||
from ...types import serializers
|
||||
|
||||
class PublicChannelsHandler:
|
||||
ONCE_PER_SUBSCRIPTION_EVENTS = [
|
||||
|
||||
Reference in New Issue
Block a user