mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
formatting fixes for latest black
This commit is contained in:
parent
ccfa989c62
commit
ac265fe75a
3 changed files with 21 additions and 18 deletions
|
@ -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)
|
||||
|
||||
|
|
|
@ -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]] = []
|
||||
|
||||
|
|
|
@ -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,
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue