mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-19 23:04:21 +01:00
Improve fidelity to pylint's standard rules.
This commit is contained in:
@@ -35,6 +35,7 @@ class PublicChannelsHandler:
|
||||
elif subscription["channel"] == "status":
|
||||
self.__status_channel_handler(cast(Status, subscription), stream)
|
||||
|
||||
#pylint: disable-next=inconsistent-return-statements
|
||||
def __ticker_channel_handler(self, subscription: Ticker, stream: List[Any]):
|
||||
if subscription["symbol"].startswith("t"):
|
||||
return self.__event_emitter.emit("t_ticker_update", subscription, \
|
||||
@@ -44,6 +45,7 @@ class PublicChannelsHandler:
|
||||
return self.__event_emitter.emit("f_ticker_update", subscription, \
|
||||
serializers.FundingCurrencyTicker.parse(*stream[0]))
|
||||
|
||||
#pylint: disable-next=inconsistent-return-statements
|
||||
def __trades_channel_handler(self, subscription: Trades, stream: List[Any]):
|
||||
if (event := stream[0]) and event in [ "te", "tu", "fte", "ftu" ]:
|
||||
events = { "te": "t_trade_execution", "tu": "t_trade_execution_update", \
|
||||
@@ -67,6 +69,7 @@ class PublicChannelsHandler:
|
||||
[ serializers.FundingCurrencyTrade.parse(*sub_stream) \
|
||||
for sub_stream in stream[0] ])
|
||||
|
||||
#pylint: disable-next=inconsistent-return-statements
|
||||
def __book_channel_handler(self, subscription: Book, stream: List[Any]):
|
||||
if subscription["symbol"].startswith("t"):
|
||||
if all(isinstance(sub_stream, list) for sub_stream in stream[0]):
|
||||
@@ -86,6 +89,7 @@ class PublicChannelsHandler:
|
||||
return self.__event_emitter.emit("f_book_update", subscription, \
|
||||
serializers.FundingCurrencyBook.parse(*stream[0]))
|
||||
|
||||
#pylint: disable-next=inconsistent-return-statements
|
||||
def __raw_book_channel_handler(self, subscription: Book, stream: List[Any]):
|
||||
if subscription["symbol"].startswith("t"):
|
||||
if all(isinstance(sub_stream, list) for sub_stream in stream[0]):
|
||||
@@ -105,6 +109,7 @@ class PublicChannelsHandler:
|
||||
return self.__event_emitter.emit("f_raw_book_update", subscription, \
|
||||
serializers.FundingCurrencyRawBook.parse(*stream[0]))
|
||||
|
||||
#pylint: disable-next=inconsistent-return-statements
|
||||
def __candles_channel_handler(self, subscription: Candles, stream: List[Any]):
|
||||
if all(isinstance(sub_stream, list) for sub_stream in stream[0]):
|
||||
return self.__event_emitter.emit("candles_snapshot", subscription, \
|
||||
@@ -114,6 +119,7 @@ class PublicChannelsHandler:
|
||||
return self.__event_emitter.emit("candles_update", subscription, \
|
||||
serializers.Candle.parse(*stream[0]))
|
||||
|
||||
#pylint: disable-next=inconsistent-return-statements
|
||||
def __status_channel_handler(self, subscription: Status, stream: List[Any]):
|
||||
if subscription["key"].startswith("deriv:"):
|
||||
return self.__event_emitter.emit("derivatives_status_update", subscription, \
|
||||
@@ -123,6 +129,7 @@ class PublicChannelsHandler:
|
||||
return self.__event_emitter.emit("liquidation_feed_update", subscription, \
|
||||
serializers.Liquidation.parse(*stream[0][0]))
|
||||
|
||||
#pylint: disable-next=inconsistent-return-statements
|
||||
def __checksum_handler(self, subscription: Book, value: int):
|
||||
return self.__event_emitter.emit( \
|
||||
"checksum", subscription, value & 0xFFFFFFFF)
|
||||
|
||||
Reference in New Issue
Block a user