mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
move hook gen code out of anki/
It's not needed at runtime, and this allows hooks to be updated even when the code is broken.
This commit is contained in:
parent
cb14963066
commit
c67aefa3ea
6 changed files with 9 additions and 5 deletions
|
@ -27,7 +27,7 @@ PROTODEPS := $(wildcard ../proto/*.proto)
|
|||
protoc --proto_path=../proto --python_out=anki --mypy_out=anki $(PROTODEPS)
|
||||
@touch $@
|
||||
|
||||
.build/hooks: tools/genhooks.py anki/hooks_gen.py
|
||||
.build/hooks: tools/genhooks.py tools/hookslib.py
|
||||
python tools/genhooks.py
|
||||
black anki/hooks.py
|
||||
@touch $@
|
||||
|
|
0
pylib/tools/__init__.py
Normal file
0
pylib/tools/__init__.py
Normal file
|
@ -11,7 +11,7 @@ To add a new hook:
|
|||
"""
|
||||
|
||||
import os
|
||||
from anki.hooks_gen import Hook, update_file
|
||||
from hookslib import Hook, update_file
|
||||
|
||||
# Hook/filter list
|
||||
######################################################################
|
||||
|
|
|
@ -35,8 +35,8 @@ TSDEPS := $(wildcard ts/src/*.ts)
|
|||
(cd ts && npm i && npm run build)
|
||||
@touch $@
|
||||
|
||||
.build/hooks: tools/genhooks.py ../pylib/anki/hooks_gen.py
|
||||
python tools/genhooks.py
|
||||
.build/hooks: tools/genhooks_gui.py ../pylib/tools/hookslib.py
|
||||
python tools/genhooks_gui.py
|
||||
black aqt/gui_hooks.py
|
||||
@touch $@
|
||||
|
||||
|
|
|
@ -6,8 +6,12 @@ See pylib/tools/genhooks.py for more info.
|
|||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
from anki.hooks_gen import Hook, update_file
|
||||
pylib = os.path.join(os.path.dirname(__file__), "..", "..", "pylib")
|
||||
sys.path.append(pylib)
|
||||
|
||||
from tools.hookslib import Hook, update_file
|
||||
|
||||
# Hook list
|
||||
######################################################################
|
Loading…
Reference in a new issue