mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-18 06:14:22 +01:00
Remove all old '# pylint:' comments from all python files.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import sys
|
||||
from copy import copy
|
||||
|
||||
# pylint: disable-next=wildcard-import,unused-wildcard-import
|
||||
from logging import *
|
||||
from typing import TYPE_CHECKING, Literal, Optional
|
||||
|
||||
@@ -42,7 +41,6 @@ class _ColorFormatter(Formatter):
|
||||
|
||||
return super().format(_record)
|
||||
|
||||
# pylint: disable-next=invalid-name
|
||||
def formatTime(self, record: LogRecord, datefmt: Optional[str] = None) -> str:
|
||||
return _GREEN + super().formatTime(record, datefmt) + _NC
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@ from ...types.serializers import _Notification
|
||||
from ..middleware import Middleware
|
||||
|
||||
|
||||
# pylint: disable-next=too-many-public-methods
|
||||
class RestAuthEndpoints(Middleware):
|
||||
def get_user_info(self) -> UserInfo:
|
||||
return serializers.UserInfo.parse(*self._post("auth/r/info/user"))
|
||||
@@ -368,7 +367,6 @@ class RestAuthEndpoints(Middleware):
|
||||
for sub_data in self._post(endpoint)
|
||||
]
|
||||
|
||||
# pylint: disable-next=too-many-arguments
|
||||
def submit_funding_offer(
|
||||
self,
|
||||
type: str,
|
||||
@@ -552,7 +550,6 @@ class RestAuthEndpoints(Middleware):
|
||||
*(self._post(f"auth/r/info/funding/{key}")[2])
|
||||
)
|
||||
|
||||
# pylint: disable-next=too-many-arguments
|
||||
def transfer_between_wallets(
|
||||
self,
|
||||
from_wallet: str,
|
||||
|
||||
@@ -28,7 +28,6 @@ _CustomerInfo = TypedDict(
|
||||
|
||||
|
||||
class RestMerchantEndpoints(Middleware):
|
||||
# pylint: disable-next=too-many-arguments
|
||||
def submit_invoice(
|
||||
self,
|
||||
amount: Union[str, float, Decimal],
|
||||
@@ -179,7 +178,6 @@ class RestMerchantEndpoints(Middleware):
|
||||
def get_merchant_settings(self, key: str) -> Any:
|
||||
return self._post("auth/r/ext/pay/settings/get", body={"key": key})
|
||||
|
||||
# pylint: disable-next=dangerous-default-value
|
||||
def list_merchant_settings(self, keys: List[str] = []) -> Dict[str, Any]:
|
||||
return self._post("auth/r/ext/pay/settings/list", body={"keys": keys})
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ from ...types import (
|
||||
from ..middleware import Middleware
|
||||
|
||||
|
||||
# pylint: disable-next=too-many-public-methods
|
||||
class RestPublicEndpoints(Middleware):
|
||||
def conf(self, config: str) -> Any:
|
||||
return self._get(f"conf/{config}")[0]
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
from . import dataclasses
|
||||
|
||||
# pylint: disable-next=unused-import
|
||||
from .labeler import (
|
||||
_Serializer,
|
||||
generate_labeler_serializer,
|
||||
generate_recursive_serializer,
|
||||
)
|
||||
|
||||
# pylint: disable-next=unused-import
|
||||
from .notification import _Notification
|
||||
|
||||
__serializers__ = [
|
||||
|
||||
@@ -67,7 +67,6 @@ class _Delay:
|
||||
self.__backoff_delay = _Delay.__BACKOFF_MIN
|
||||
|
||||
|
||||
# pylint: disable-next=too-many-instance-attributes
|
||||
class BfxWebSocketClient(Connection):
|
||||
def __init__(
|
||||
self,
|
||||
@@ -101,7 +100,6 @@ class BfxWebSocketClient(Connection):
|
||||
type(exception), exception, exception.__traceback__
|
||||
)
|
||||
|
||||
# pylint: disable-next=logging-not-lazy
|
||||
self.__logger.critical(header + "\n" + str().join(stack_trace)[:-1])
|
||||
|
||||
@property
|
||||
@@ -111,7 +109,6 @@ class BfxWebSocketClient(Connection):
|
||||
def run(self) -> None:
|
||||
return asyncio.get_event_loop().run_until_complete(self.start())
|
||||
|
||||
# pylint: disable-next=too-many-branches
|
||||
async def start(self) -> None:
|
||||
_delay = _Delay(backoff_factor=1.618)
|
||||
|
||||
@@ -149,7 +146,6 @@ class BfxWebSocketClient(Connection):
|
||||
except asyncio.CancelledError:
|
||||
pass
|
||||
|
||||
# pylint: disable-next=consider-using-dict-items
|
||||
for bucket in self.__buckets:
|
||||
if task := self.__buckets[bucket]:
|
||||
self.__buckets[bucket] = None
|
||||
@@ -185,14 +181,12 @@ class BfxWebSocketClient(Connection):
|
||||
(isinstance(error, InvalidStatusCode) and error.status_code == 408)
|
||||
or isinstance(error, gaierror)
|
||||
) and self.__reconnection:
|
||||
# pylint: disable-next=logging-fstring-interpolation
|
||||
self.__logger.warning(
|
||||
"Reconnection attempt unsuccessful (no."
|
||||
f"{self.__reconnection['attempts']}): next attempt in "
|
||||
f"~{int(_delay.peek())}.0s."
|
||||
)
|
||||
|
||||
# pylint: disable-next=logging-fstring-interpolation
|
||||
self.__logger.info(
|
||||
f"The client has been offline for "
|
||||
f"{datetime.now() - self.__reconnection['timestamp']}."
|
||||
@@ -214,7 +208,6 @@ class BfxWebSocketClient(Connection):
|
||||
async def __connect(self) -> None:
|
||||
async with websockets.client.connect(self._host) as websocket:
|
||||
if self.__reconnection:
|
||||
# pylint: disable-next=logging-fstring-interpolation
|
||||
self.__logger.warning(
|
||||
"Reconnection attempt successful (no."
|
||||
f"{self.__reconnection['attempts']}): recovering "
|
||||
@@ -307,7 +300,6 @@ class BfxWebSocketClient(Connection):
|
||||
|
||||
@Connection._require_websocket_connection
|
||||
async def unsubscribe(self, sub_id: str) -> None:
|
||||
# pylint: disable-next=consider-using-dict-items
|
||||
for bucket in self.__buckets:
|
||||
if bucket.has(sub_id):
|
||||
if bucket.count == 1:
|
||||
|
||||
@@ -99,7 +99,6 @@ class BfxWebSocketInputs:
|
||||
"oc_multi", {"id": id, "cid": cid, "gid": gid, "all": all}
|
||||
)
|
||||
|
||||
# pylint: disable-next=too-many-arguments
|
||||
async def submit_funding_offer(
|
||||
self,
|
||||
type: str,
|
||||
|
||||
@@ -6,7 +6,6 @@ from datetime import datetime
|
||||
from functools import wraps
|
||||
from typing import Any, Awaitable, Callable, Dict, List, Optional, TypeVar, cast
|
||||
|
||||
# pylint: disable-next=wrong-import-order
|
||||
from typing_extensions import Concatenate, ParamSpec
|
||||
from websockets.client import WebSocketClientProtocol
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@ 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(
|
||||
@@ -55,7 +54,6 @@ class PublicChannelsHandler:
|
||||
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 = {
|
||||
@@ -99,7 +97,6 @@ class PublicChannelsHandler:
|
||||
],
|
||||
)
|
||||
|
||||
# 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]):
|
||||
@@ -135,7 +132,6 @@ class PublicChannelsHandler:
|
||||
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]):
|
||||
@@ -171,7 +167,6 @@ class PublicChannelsHandler:
|
||||
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(
|
||||
@@ -184,7 +179,6 @@ class PublicChannelsHandler:
|
||||
"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(
|
||||
@@ -200,6 +194,5 @@ class PublicChannelsHandler:
|
||||
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