From ba98bcd4a07c589722c6db103b363c8aa1d3561d Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Mon, 24 Dec 2018 09:43:45 +0100 Subject: Use f-strings where possible Replaces str.format, which is less readable due to its separation of format and arguments. --- crocoite/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crocoite/util.py') diff --git a/crocoite/util.py b/crocoite/util.py index eebe909..5bced53 100644 --- a/crocoite/util.py +++ b/crocoite/util.py @@ -48,8 +48,8 @@ def packageUrl (path): async def getFormattedViewportMetrics (tab): layoutMetrics = await tab.Page.getLayoutMetrics () # XXX: I’m not entirely sure which one we should use here - return '{}x{}'.format (layoutMetrics['layoutViewport']['clientWidth'], - layoutMetrics['layoutViewport']['clientHeight']) + viewport = layoutMetrics['layoutViewport'] + return f"{viewport['clientWidth']}x{viewport['clientHeight']}" def getSoftwareInfo (): """ Get software info for inclusion into warcinfo """ -- cgit v1.2.3