mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-19 06:44:22 +01:00
Apply pylint's linting rules to bfxapi/websocket/__init__.py, bfxapi/websocket/enums.py, bfxapi/websocket/exceptions.py, bfxapi/websocket/serializers.py and bfxapi/websocket/subscriptions.py.
This commit is contained in:
@@ -14,4 +14,4 @@ disable=
|
|||||||
|
|
||||||
[FORMAT]
|
[FORMAT]
|
||||||
|
|
||||||
max-line-length=120
|
max-line-length=130
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
from .client import BfxWebsocketClient, BfxWebsocketBucket, BfxWebsocketInputs
|
from .client import BfxWebsocketClient, BfxWebsocketBucket, BfxWebsocketInputs
|
||||||
|
|
||||||
NAME = "websocket"
|
NAME = "websocket"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#pylint: disable-next=wildcard-import,unused-wildcard-import
|
||||||
from .. enums import *
|
from .. enums import *
|
||||||
|
|
||||||
class Channel(str, Enum):
|
class Channel(str, Enum):
|
||||||
@@ -5,4 +6,4 @@ class Channel(str, Enum):
|
|||||||
TRADES = "trades"
|
TRADES = "trades"
|
||||||
BOOK = "book"
|
BOOK = "book"
|
||||||
CANDLES = "candles"
|
CANDLES = "candles"
|
||||||
STATUS = "status"
|
STATUS = "status"
|
||||||
|
|||||||
@@ -16,53 +16,39 @@ class BfxWebsocketException(BfxBaseException):
|
|||||||
Base class for all custom exceptions in bfxapi/websocket/exceptions.py.
|
Base class for all custom exceptions in bfxapi/websocket/exceptions.py.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
pass
|
|
||||||
|
|
||||||
class ConnectionNotOpen(BfxWebsocketException):
|
class ConnectionNotOpen(BfxWebsocketException):
|
||||||
"""
|
"""
|
||||||
This error indicates an attempt to communicate via websocket before starting the connection with the servers.
|
This error indicates an attempt to communicate via websocket before starting the connection with the servers.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
pass
|
|
||||||
|
|
||||||
class TooManySubscriptions(BfxWebsocketException):
|
class TooManySubscriptions(BfxWebsocketException):
|
||||||
"""
|
"""
|
||||||
This error indicates an attempt to subscribe to a public channel after reaching the limit of simultaneous connections.
|
This error indicates a subscription attempt after reaching the limit of simultaneous connections.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
pass
|
|
||||||
|
|
||||||
class WebsocketAuthenticationRequired(BfxWebsocketException):
|
class WebsocketAuthenticationRequired(BfxWebsocketException):
|
||||||
"""
|
"""
|
||||||
This error indicates an attempt to access a protected resource without logging in first.
|
This error indicates an attempt to access a protected resource without logging in first.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
pass
|
|
||||||
|
|
||||||
class EventNotSupported(BfxWebsocketException):
|
class EventNotSupported(BfxWebsocketException):
|
||||||
"""
|
"""
|
||||||
This error indicates a failed attempt to subscribe to an event not supported by the BfxWebsocketClient.
|
This error indicates a failed attempt to subscribe to an event not supported by the BfxWebsocketClient.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
pass
|
|
||||||
|
|
||||||
class OutdatedClientVersion(BfxWebsocketException):
|
class OutdatedClientVersion(BfxWebsocketException):
|
||||||
"""
|
"""
|
||||||
This error indicates a mismatch between the client version and the server WSS version.
|
This error indicates a mismatch between the client version and the server WSS version.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
pass
|
|
||||||
|
|
||||||
class InvalidAuthenticationCredentials(BfxWebsocketException):
|
class InvalidAuthenticationCredentials(BfxWebsocketException):
|
||||||
"""
|
"""
|
||||||
This error indicates that the user has provided incorrect credentials (API-KEY and API-SECRET) for authentication.
|
This error indicates that the user has provided incorrect credentials (API-KEY and API-SECRET) for authentication.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
pass
|
|
||||||
|
|
||||||
class HandlerNotFound(BfxWebsocketException):
|
class HandlerNotFound(BfxWebsocketException):
|
||||||
"""
|
"""
|
||||||
This error indicates that a handler was not found for an incoming message.
|
This error indicates that a handler was not found for an incoming message.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
pass
|
|
||||||
@@ -2,6 +2,7 @@ from . import types
|
|||||||
|
|
||||||
from .. labeler import generate_labeler_serializer
|
from .. labeler import generate_labeler_serializer
|
||||||
|
|
||||||
|
#pylint: disable-next=unused-import
|
||||||
from .. notification import _Notification
|
from .. notification import _Notification
|
||||||
|
|
||||||
__serializers__ = [
|
__serializers__ = [
|
||||||
@@ -49,14 +50,14 @@ FundingCurrencyTicker = generate_labeler_serializer("FundingCurrencyTicker", kla
|
|||||||
"frr_amount_available"
|
"frr_amount_available"
|
||||||
])
|
])
|
||||||
|
|
||||||
TradingPairTrade = generate_labeler_serializer("TradingPairTrade", klass=types.TradingPairTrade, labels=[
|
TradingPairTrade = generate_labeler_serializer("TradingPairTrade", klass=types.TradingPairTrade, labels=[
|
||||||
"id",
|
"id",
|
||||||
"mts",
|
"mts",
|
||||||
"amount",
|
"amount",
|
||||||
"price"
|
"price"
|
||||||
])
|
])
|
||||||
|
|
||||||
FundingCurrencyTrade = generate_labeler_serializer("FundingCurrencyTrade", klass=types.FundingCurrencyTrade, labels=[
|
FundingCurrencyTrade = generate_labeler_serializer("FundingCurrencyTrade", klass=types.FundingCurrencyTrade, labels=[
|
||||||
"id",
|
"id",
|
||||||
"mts",
|
"mts",
|
||||||
"amount",
|
"amount",
|
||||||
@@ -290,4 +291,4 @@ Balance = generate_labeler_serializer("Balance", klass=types.Balance, labels=[
|
|||||||
"aum_net",
|
"aum_net",
|
||||||
])
|
])
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@@ -15,12 +15,14 @@ _Header = TypedDict("_Header", { "event": Literal["subscribed"], "channel": str,
|
|||||||
Subscription = Union["Ticker", "Trades", "Book", "Candles", "Status"]
|
Subscription = Union["Ticker", "Trades", "Book", "Candles", "Status"]
|
||||||
|
|
||||||
class Ticker(TypedDict):
|
class Ticker(TypedDict):
|
||||||
subId: str; symbol: str
|
subId: str
|
||||||
|
symbol: str
|
||||||
pair: Optional[str]
|
pair: Optional[str]
|
||||||
currency: Optional[str]
|
currency: Optional[str]
|
||||||
|
|
||||||
class Trades(TypedDict):
|
class Trades(TypedDict):
|
||||||
subId: str; symbol: str
|
subId: str
|
||||||
|
symbol: str
|
||||||
pair: Optional[str]
|
pair: Optional[str]
|
||||||
currency: Optional[str]
|
currency: Optional[str]
|
||||||
|
|
||||||
@@ -38,4 +40,4 @@ class Candles(TypedDict):
|
|||||||
|
|
||||||
class Status(TypedDict):
|
class Status(TypedDict):
|
||||||
subId: str
|
subId: str
|
||||||
key: str
|
key: str
|
||||||
|
|||||||
Reference in New Issue
Block a user