Improve some bugbear findings

This commit is contained in:
Matthias 2024-04-20 09:51:11 +02:00
parent 6dfc34d227
commit 927c54094a
4 changed files with 6 additions and 4 deletions

View File

@ -1549,7 +1549,7 @@ class Telegram(RPCHandler):
async def send_blacklist_msg(self, blacklist: Dict):
errmsgs = []
for pair, error in blacklist['errors'].items():
for _, error in blacklist['errors'].items():
errmsgs.append(f"Error: {error['error_msg']}")
if errmsgs:
await self._send_msg('\n'.join(errmsgs))

View File

@ -64,7 +64,7 @@ def informative(timeframe: str, asset: str = '',
def decorator(fn: PopulateIndicators):
informative_pairs = getattr(fn, '_ft_informative', [])
informative_pairs.append(InformativeData(_asset, _timeframe, _fmt, _ffill, _candle_type))
setattr(fn, '_ft_informative', informative_pairs)
setattr(fn, '_ft_informative', informative_pairs) # noqa: B010
return fn
return decorator

View File

@ -67,7 +67,7 @@ def print_commands():
# Print dynamic help for the different commands using the commands doc-strings
client = FtRestClient(None)
print("Possible commands:\n")
for x, y in inspect.getmembers(client):
for x, _ in inspect.getmembers(client):
if not x.startswith('_'):
doc = re.sub(':return:.*', '', getattr(client, x).__doc__, flags=re.MULTILINE).rstrip()
print(f"{x}\n\t{doc}\n")

View File

@ -201,7 +201,7 @@ async def create_client(
token,
scheme='ws',
name='default',
protocol=ClientProtocol(),
protocol=None,
sleep_time=10,
ping_timeout=10,
wait_timeout=30,
@ -216,6 +216,8 @@ async def create_client(
:param name: The name of the producer
:param **kwargs: Any extra kwargs passed to websockets.connect
"""
if not protocol:
protocol = ClientProtocol()
while 1:
try: