diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2018-12-24 09:43:45 +0100 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2018-12-24 09:43:45 +0100 |
commit | ba98bcd4a07c589722c6db103b363c8aa1d3561d (patch) | |
tree | 22c7651ad945c502e4b1154d8dccd7f0dcaaba54 /crocoite/util.py | |
parent | 36447c97a0036592d3748fbe594928ae9c76d5af (diff) | |
download | crocoite-ba98bcd4a07c589722c6db103b363c8aa1d3561d.tar.gz crocoite-ba98bcd4a07c589722c6db103b363c8aa1d3561d.tar.bz2 crocoite-ba98bcd4a07c589722c6db103b363c8aa1d3561d.zip |
Use f-strings where possible
Replaces str.format, which is less readable due to its separation of
format and arguments.
Diffstat (limited to 'crocoite/util.py')
-rw-r--r-- | crocoite/util.py | 4 |
1 files changed, 2 insertions, 2 deletions
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 """ |