From ac265fe75aed681a519597a5e01925ebb0d2e28b Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 31 Aug 2020 13:32:49 +1000 Subject: [PATCH] formatting fixes for latest black --- pylib/anki/schedv2.py | 3 ++- qt/aqt/gui_hooks.py | 31 +++++++++++++++---------------- qt/aqt/mediasrv.py | 5 ++++- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/pylib/anki/schedv2.py b/pylib/anki/schedv2.py index d7197d57a..fedf002b1 100644 --- a/pylib/anki/schedv2.py +++ b/pylib/anki/schedv2.py @@ -1382,7 +1382,8 @@ where id = ? self.col.backend.restore_buried_and_suspended_cards(ids) def unbury_cards_in_current_deck( - self, mode: UnburyCurrentDeckModeValue = UnburyCurrentDeckMode.ALL, + self, + mode: UnburyCurrentDeckModeValue = UnburyCurrentDeckMode.ALL, ) -> None: self.col.backend.unbury_cards_in_current_deck(mode) diff --git a/qt/aqt/gui_hooks.py b/qt/aqt/gui_hooks.py index 2386341fc..0ddb69c15 100644 --- a/qt/aqt/gui_hooks.py +++ b/qt/aqt/gui_hooks.py @@ -2846,25 +2846,24 @@ undo_state_did_change = _UndoStateDidChangeHook() class _WebviewDidInjectStyleIntoPageHook: '''Called after standard styling is injected into an external -html file, such as when loading the new graphs. You can use this hook to -mutate the DOM before the page is revealed. + html file, such as when loading the new graphs. You can use this hook to + mutate the DOM before the page is revealed. -For example: + For example: -def mytest(web: AnkiWebView): - page = os.path.basename(web.page().url().path()) - if page != "graphs.html": - return - web.eval( - """ - div = document.createElement("div"); - div.innerHTML = 'hello'; - document.body.appendChild(div); -""" - ) + def mytest(web: AnkiWebView): + page = os.path.basename(web.page().url().path()) + if page != "graphs.html": + return + web.eval( + """ + div = document.createElement("div"); + div.innerHTML = 'hello'; + document.body.appendChild(div); + """ + ) -gui_hooks.webview_did_inject_style_into_page.append(mytest) -''' + gui_hooks.webview_did_inject_style_into_page.append(mytest)''' _hooks: List[Callable[["aqt.webview.AnkiWebView"], None]] = [] diff --git a/qt/aqt/mediasrv.py b/qt/aqt/mediasrv.py index 880455fc2..8c5d8c91f 100644 --- a/qt/aqt/mediasrv.py +++ b/qt/aqt/mediasrv.py @@ -230,4 +230,7 @@ def handle_post(path: str) -> Response: response.headers["Content-Type"] = "application/binary" return response else: - return flask.make_response(f"Unhandled post to {path}", HTTPStatus.FORBIDDEN,) + return flask.make_response( + f"Unhandled post to {path}", + HTTPStatus.FORBIDDEN, + )