mirror of
https://github.com/NohamR/TransmissionBot.git
synced 2025-05-24 00:48:59 +00:00
quoted strings in t/info output
This commit is contained in:
parent
b64afd3dea
commit
ab5ac15006
4
bot.py
4
bot.py
@ -2830,11 +2830,11 @@ async def print_info(message, content=""):
|
|||||||
'version': session.version,
|
'version': session.version,
|
||||||
}
|
}
|
||||||
|
|
||||||
trpcStr = '\n'.join(['{}: {}'.format(k,v) for k,v in trpcinfo.items()])
|
trpcStr = '\n'.join(["{}: {}{}{}".format(k,"'" if isinstance(v,str) else '', v, "'" if isinstance(v,str) else '') for k,v in trpcinfo.items()])
|
||||||
|
|
||||||
# get session statistics
|
# get session statistics
|
||||||
try:
|
try:
|
||||||
stats = ['\n'.join(['{}: {}'.format(k,v) for k,v in {'downloaded': humanbytes(stat['downloadedBytes'],d=1), 'uploaded': humanbytes(stat['uploadedBytes'],d=1), 'files added': humancount(stat['filesAdded'],d=1), 'session count': stat['sessionCount'], 'uptime': humantime(stat['secondsActive'], compact_output=False)}.items()]) for stat in [session.current_stats,session.cumulative_stats]]
|
stats = ['\n'.join(["{}: {}{}{}".format(k,"'" if isinstance(v,str) else '', v, "'" if isinstance(v,str) else '') for k,v in {'downloaded': humanbytes(stat['downloadedBytes'],d=1), 'uploaded': humanbytes(stat['uploadedBytes'],d=1), 'files added': humancount(stat['filesAdded'],d=1), 'session count': stat['sessionCount'], 'uptime': humantime(stat['secondsActive'], compact_output=False)}.items()]) for stat in [session.current_stats,session.cumulative_stats]]
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error("Failed to get transmission session statistics: {}".format(e))
|
logger.error("Failed to get transmission session statistics: {}".format(e))
|
||||||
stats = ['Failed to get', 'Failed to get']
|
stats = ['Failed to get', 'Failed to get']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user