Use QUTE_DATA_DIR in readability userscript

This commit is contained in:
Jay Kamat 2018-02-18 14:28:46 -05:00
parent ab0034f9da
commit c844023077
No known key found for this signature in database
GPG Key ID: 5D2E399600F4F7B5

View File

@ -13,7 +13,13 @@
from __future__ import absolute_import from __future__ import absolute_import
import codecs, os import codecs, os
tmpfile=os.path.expanduser('~/.local/share/qutebrowser/userscripts/readability.html') 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')
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))