mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12: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)
|
self.col.backend.restore_buried_and_suspended_cards(ids)
|
||||||
|
|
||||||
def unbury_cards_in_current_deck(
|
def unbury_cards_in_current_deck(
|
||||||
self, mode: UnburyCurrentDeckModeValue = UnburyCurrentDeckMode.ALL,
|
self,
|
||||||
|
mode: UnburyCurrentDeckModeValue = UnburyCurrentDeckMode.ALL,
|
||||||
) -> None:
|
) -> None:
|
||||||
self.col.backend.unbury_cards_in_current_deck(mode)
|
self.col.backend.unbury_cards_in_current_deck(mode)
|
||||||
|
|
||||||
|
|
|
@ -2846,12 +2846,12 @@ undo_state_did_change = _UndoStateDidChangeHook()
|
||||||
|
|
||||||
class _WebviewDidInjectStyleIntoPageHook:
|
class _WebviewDidInjectStyleIntoPageHook:
|
||||||
'''Called after standard styling is injected into an external
|
'''Called after standard styling is injected into an external
|
||||||
html file, such as when loading the new graphs. You can use this hook to
|
html file, such as when loading the new graphs. You can use this hook to
|
||||||
mutate the DOM before the page is revealed.
|
mutate the DOM before the page is revealed.
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
def mytest(web: AnkiWebView):
|
def mytest(web: AnkiWebView):
|
||||||
page = os.path.basename(web.page().url().path())
|
page = os.path.basename(web.page().url().path())
|
||||||
if page != "graphs.html":
|
if page != "graphs.html":
|
||||||
return
|
return
|
||||||
|
@ -2860,11 +2860,10 @@ def mytest(web: AnkiWebView):
|
||||||
div = document.createElement("div");
|
div = document.createElement("div");
|
||||||
div.innerHTML = 'hello';
|
div.innerHTML = 'hello';
|
||||||
document.body.appendChild(div);
|
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]] = []
|
_hooks: List[Callable[["aqt.webview.AnkiWebView"], None]] = []
|
||||||
|
|
||||||
|
|
|
@ -230,4 +230,7 @@ def handle_post(path: str) -> Response:
|
||||||
response.headers["Content-Type"] = "application/binary"
|
response.headers["Content-Type"] = "application/binary"
|
||||||
return response
|
return response
|
||||||
else:
|
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