Fix pep8/pylint
This commit is contained in:
parent
738fad50da
commit
d7d577b1fa
@ -34,7 +34,6 @@ import configparser
|
|||||||
|
|
||||||
from PyQt5.QtCore import pyqtSlot, QObject
|
from PyQt5.QtCore import pyqtSlot, QObject
|
||||||
from PyQt5.QtNetwork import QNetworkReply
|
from PyQt5.QtNetwork import QNetworkReply
|
||||||
from PyQt5.QtWebKit import QWebSecurityOrigin
|
|
||||||
|
|
||||||
import qutebrowser
|
import qutebrowser
|
||||||
from qutebrowser.browser import pdfjs
|
from qutebrowser.browser import pdfjs
|
||||||
|
@ -107,7 +107,7 @@ def get_pdfjs_res(path):
|
|||||||
# First try a system wide installation
|
# First try a system wide installation
|
||||||
# System installations might strip off the 'build/' or 'web/' prefixes.
|
# System installations might strip off the 'build/' or 'web/' prefixes.
|
||||||
# qute expects them, so we need to adjust for it.
|
# 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:
|
for system_path in SYSTEM_PDFJS_PATHS:
|
||||||
content = _read_from_system(system_path, names_to_try)
|
content = _read_from_system(system_path, names_to_try)
|
||||||
if content is not None:
|
if content is not None:
|
||||||
|
@ -223,6 +223,8 @@ class BrowserPage(QWebPage):
|
|||||||
try:
|
try:
|
||||||
page = pdfjs.generate_pdfjs_page(reply.url()).encode('utf-8')
|
page = pdfjs.generate_pdfjs_page(reply.url()).encode('utf-8')
|
||||||
except pdfjs.PDFJSNotFound:
|
except pdfjs.PDFJSNotFound:
|
||||||
|
# pylint: disable=no-member
|
||||||
|
# Instance of 'str' has no 'render' member (no-member)
|
||||||
page = (jinja.env.get_template('no_pdfjs.html')
|
page = (jinja.env.get_template('no_pdfjs.html')
|
||||||
.render(url=reply.url().toDisplayString())
|
.render(url=reply.url().toDisplayString())
|
||||||
.encode('utf-8'))
|
.encode('utf-8'))
|
||||||
|
@ -43,6 +43,7 @@ def get_latest_pdfjs_url():
|
|||||||
|
|
||||||
|
|
||||||
def update_pdfjs():
|
def update_pdfjs():
|
||||||
|
"""Download and extract the latest pdf.js version."""
|
||||||
version, url = get_latest_pdfjs_url()
|
version, url = get_latest_pdfjs_url()
|
||||||
target_path = os.path.join('qutebrowser', '3rdparty', 'pdfjs')
|
target_path = os.path.join('qutebrowser', '3rdparty', 'pdfjs')
|
||||||
print("=> Downloading pdf.js {}".format(version))
|
print("=> Downloading pdf.js {}".format(version))
|
||||||
@ -56,8 +57,6 @@ def update_pdfjs():
|
|||||||
shutil.unpack_archive(archive, target_path, 'zip')
|
shutil.unpack_archive(archive, target_path, 'zip')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
update_pdfjs()
|
update_pdfjs()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user