Fix pep8/pylint

This commit is contained in:
Daniel Schadt 2015-11-23 23:06:07 +01:00
parent 738fad50da
commit d7d577b1fa
4 changed files with 4 additions and 4 deletions

View File

@ -34,7 +34,6 @@ import configparser
from PyQt5.QtCore import pyqtSlot, QObject
from PyQt5.QtNetwork import QNetworkReply
from PyQt5.QtWebKit import QWebSecurityOrigin
import qutebrowser
from qutebrowser.browser import pdfjs

View File

@ -107,7 +107,7 @@ def get_pdfjs_res(path):
# First try a system wide installation
# System installations might strip off the 'build/' or 'web/' prefixes.
# qute expects them, so we need to adjust for it.
names_to_try = [path, path[path.index('/')+1:]]
names_to_try = [path, path[path.index('/') + 1:]]
for system_path in SYSTEM_PDFJS_PATHS:
content = _read_from_system(system_path, names_to_try)
if content is not None:

View File

@ -223,6 +223,8 @@ class BrowserPage(QWebPage):
try:
page = pdfjs.generate_pdfjs_page(reply.url()).encode('utf-8')
except pdfjs.PDFJSNotFound:
# pylint: disable=no-member
# Instance of 'str' has no 'render' member (no-member)
page = (jinja.env.get_template('no_pdfjs.html')
.render(url=reply.url().toDisplayString())
.encode('utf-8'))

View File

@ -43,6 +43,7 @@ def get_latest_pdfjs_url():
def update_pdfjs():
"""Download and extract the latest pdf.js version."""
version, url = get_latest_pdfjs_url()
target_path = os.path.join('qutebrowser', '3rdparty', 'pdfjs')
print("=> Downloading pdf.js {}".format(version))
@ -56,8 +57,6 @@ def update_pdfjs():
shutil.unpack_archive(archive, target_path, 'zip')
def main():
update_pdfjs()