From 84907d5a2e6da150311d802fa4eb9a3e96270b52 Mon Sep 17 00:00:00 2001 From: Jay Kamat Date: Sun, 18 Feb 2018 14:49:09 -0500 Subject: [PATCH] Simplify readability logic using get defaults :D --- misc/userscripts/readability | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/misc/userscripts/readability b/misc/userscripts/readability index f6df5000f..d0ef43795 100755 --- a/misc/userscripts/readability +++ b/misc/userscripts/readability @@ -13,12 +13,10 @@ from __future__ import absolute_import import codecs, os -if 'QUTE_DATA_DIR' in os.environ: - tmpfile = os.path.join(os.environ['QUTE_DATA_DIR'], - 'userscripts/readability.html') -else: - tmpfile = os.path.expanduser( - '~/.local/share/qutebrowser/userscripts/readability.html') +tmpfile = os.path.join( + os.environ.get('QUTE_DATA_DIR', + os.path.expanduser('~/.local/share/qutebrowser')), + 'userscripts/readability.html') if not os.path.exists(os.path.dirname(tmpfile)): os.makedirs(os.path.dirname(tmpfile))