From ff4c00209679bf8e7b739cf028797fb1eba723af Mon Sep 17 00:00:00 2001 From: meles5 Date: Sat, 17 Oct 2015 17:33:05 +0200 Subject: [PATCH] A few changes --- MANIFEST.in | 2 +- qutebrowser/browser/network/filescheme.py | 5 +---- qutebrowser/utils/jinja.py | 10 +++++----- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 80f440197..1e7730676 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,7 +2,7 @@ global-exclude __pycache__ *.pyc *.pyo recursive-include qutebrowser *.py recursive-include qutebrowser/html *.html -recursive-include qutebrowser/img *.svg +recursive-include qutebrowser/img *.svg *.png recursive-include qutebrowser/test *.py recursive-include qutebrowser/javascript *.js graft icons diff --git a/qutebrowser/browser/network/filescheme.py b/qutebrowser/browser/network/filescheme.py index 2432ca74a..fc1cb60d7 100644 --- a/qutebrowser/browser/network/filescheme.py +++ b/qutebrowser/browser/network/filescheme.py @@ -25,10 +25,8 @@ import os -from PyQt5.QtCore import QUrl - from qutebrowser.browser.network import schemehandler, networkreply -from qutebrowser.utils import utils, jinja +from qutebrowser.utils import jinja def get_file_list(basedir, all_files, filterfunc): @@ -76,7 +74,6 @@ def dirbrowser_html(path): # pylint: disable=no-member # https://bitbucket.org/logilab/pylint/issue/490/ - if is_root(path): parent = None else: diff --git a/qutebrowser/utils/jinja.py b/qutebrowser/utils/jinja.py index b0b9c4a89..eb2fc1e7a 100644 --- a/qutebrowser/utils/jinja.py +++ b/qutebrowser/utils/jinja.py @@ -63,11 +63,11 @@ def _guess_autoescape(template_name): def resource_url(path): - # If Windows is the operating system, replace slashes with backslashes - if os.name == "nt": - path = path.replace("/", os.sep) - path = path[:-1] - + """Load images from a relative path (to qutebrowser). + + Arguments: + path: The relative path to the image + """ image = utils.resource_filename(path) return QUrl.fromLocalFile(image).toString(QUrl.FullyEncoded)