From f9c465a636fe2f87de17ef1afdacfddf75509d09 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Wed, 23 Jan 2019 16:45:09 -0500 Subject: [PATCH] f string --- lbrynet/extras/daemon/Daemon.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/lbrynet/extras/daemon/Daemon.py b/lbrynet/extras/daemon/Daemon.py index c68819716..c99c838d6 100644 --- a/lbrynet/extras/daemon/Daemon.py +++ b/lbrynet/extras/daemon/Daemon.py @@ -751,17 +751,13 @@ class Daemon(metaclass=JSONRPCServerType): platform_name = system_info.get_platform()['platform'] webhook = utils.deobfuscate(SLACK_WEBHOOK) - payload_template = "os: %s\n version: %s\n<%s|loggly>\n%s" - payload_params = ( - platform_name, - __version__, - get_loggly_query_string(self.installation_id), - message - ) - payload = { - "text": payload_template % payload_params - } - async with aiohttp.request('post', webhook, data=json.dumps(payload)) as response: + payload = json.dumps({ + "text": f"os: {platform_name}\n" + f" version: {__version__}\n" + f"<{get_loggly_query_string(self.installation_id)}|loggly>\n" + f"{message}" + }) + async with aiohttp.request('post', webhook, data=payload): pass return True