Simplify readability logic using get defaults
:D
This commit is contained in:
parent
c844023077
commit
84907d5a2e
@ -13,12 +13,10 @@
|
|||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
import codecs, os
|
import codecs, os
|
||||||
|
|
||||||
if 'QUTE_DATA_DIR' in os.environ:
|
tmpfile = os.path.join(
|
||||||
tmpfile = os.path.join(os.environ['QUTE_DATA_DIR'],
|
os.environ.get('QUTE_DATA_DIR',
|
||||||
'userscripts/readability.html')
|
os.path.expanduser('~/.local/share/qutebrowser')),
|
||||||
else:
|
'userscripts/readability.html')
|
||||||
tmpfile = os.path.expanduser(
|
|
||||||
'~/.local/share/qutebrowser/userscripts/readability.html')
|
|
||||||
|
|
||||||
if not os.path.exists(os.path.dirname(tmpfile)):
|
if not os.path.exists(os.path.dirname(tmpfile)):
|
||||||
os.makedirs(os.path.dirname(tmpfile))
|
os.makedirs(os.path.dirname(tmpfile))
|
||||||
|
Loading…
Reference in New Issue
Block a user