Improve some bugbear findings
This commit is contained in:
@@ -1549,7 +1549,7 @@ class Telegram(RPCHandler):
|
|||||||
|
|
||||||
async def send_blacklist_msg(self, blacklist: Dict):
|
async def send_blacklist_msg(self, blacklist: Dict):
|
||||||
errmsgs = []
|
errmsgs = []
|
||||||
for pair, error in blacklist['errors'].items():
|
for _, error in blacklist['errors'].items():
|
||||||
errmsgs.append(f"Error: {error['error_msg']}")
|
errmsgs.append(f"Error: {error['error_msg']}")
|
||||||
if errmsgs:
|
if errmsgs:
|
||||||
await self._send_msg('\n'.join(errmsgs))
|
await self._send_msg('\n'.join(errmsgs))
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ def informative(timeframe: str, asset: str = '',
|
|||||||
def decorator(fn: PopulateIndicators):
|
def decorator(fn: PopulateIndicators):
|
||||||
informative_pairs = getattr(fn, '_ft_informative', [])
|
informative_pairs = getattr(fn, '_ft_informative', [])
|
||||||
informative_pairs.append(InformativeData(_asset, _timeframe, _fmt, _ffill, _candle_type))
|
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 fn
|
||||||
return decorator
|
return decorator
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ def print_commands():
|
|||||||
# Print dynamic help for the different commands using the commands doc-strings
|
# Print dynamic help for the different commands using the commands doc-strings
|
||||||
client = FtRestClient(None)
|
client = FtRestClient(None)
|
||||||
print("Possible commands:\n")
|
print("Possible commands:\n")
|
||||||
for x, y in inspect.getmembers(client):
|
for x, _ in inspect.getmembers(client):
|
||||||
if not x.startswith('_'):
|
if not x.startswith('_'):
|
||||||
doc = re.sub(':return:.*', '', getattr(client, x).__doc__, flags=re.MULTILINE).rstrip()
|
doc = re.sub(':return:.*', '', getattr(client, x).__doc__, flags=re.MULTILINE).rstrip()
|
||||||
print(f"{x}\n\t{doc}\n")
|
print(f"{x}\n\t{doc}\n")
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ async def create_client(
|
|||||||
token,
|
token,
|
||||||
scheme='ws',
|
scheme='ws',
|
||||||
name='default',
|
name='default',
|
||||||
protocol=ClientProtocol(),
|
protocol=None,
|
||||||
sleep_time=10,
|
sleep_time=10,
|
||||||
ping_timeout=10,
|
ping_timeout=10,
|
||||||
wait_timeout=30,
|
wait_timeout=30,
|
||||||
@@ -216,6 +216,8 @@ async def create_client(
|
|||||||
:param name: The name of the producer
|
:param name: The name of the producer
|
||||||
:param **kwargs: Any extra kwargs passed to websockets.connect
|
:param **kwargs: Any extra kwargs passed to websockets.connect
|
||||||
"""
|
"""
|
||||||
|
if not protocol:
|
||||||
|
protocol = ClientProtocol()
|
||||||
|
|
||||||
while 1:
|
while 1:
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user