From 9a103b37163aede72b0b19d4b43ba413f4a1183a Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sat, 2 Oct 2021 22:47:13 +1000 Subject: [PATCH] use extra variable in stdHtml() to work around a pylint crash --- qt/aqt/webview.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/qt/aqt/webview.py b/qt/aqt/webview.py index 0e5d75d35..5e5f50e7a 100644 --- a/qt/aqt/webview.py +++ b/qt/aqt/webview.py @@ -460,19 +460,20 @@ html {{ {font} }} context: Optional[Any] = None, default_css: bool = True, ) -> None: - + css = (["css/webview.css"] if default_css else []) + ( + [] if css is None else css + ) web_content = WebContent( body=body, head=head, js=["js/webview.js"] + (["js/vendor/jquery.min.js"] if js is None else js), - css=(["css/webview.css"] if default_css else []) - + ([] if css is None else css), + css=css, ) gui_hooks.webview_will_set_content(web_content, context) csstxt = "" - if "css/webview.css" in web_content.css: + if "css/webview.css" in css: # we want our dynamic styling to override the defaults in # css/webview.css, but come before user-provided stylesheets so that # they can override us if necessary