Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add WO_ANKI env var #40

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

Madoshakalaka
Copy link

First there was a typo in the Running without Anki session in the Readme for linux systems. It's ~/.local/ instead of ~/local (as indicated in the code and as XDG default)

Second... I was trying to run it without anki and weirdly encountered errors as it seems to have found the wrong directory:

> python run_server.py
Initializing database. This make take a while...
(init_db) Adding entries from nhk16...
(make_nhk16_table) Cannot find entries file: /home/maa/Projects/local-audio-yomichan/plugin/user_files/nhk16_files/entries.json
(init_db) Adding entries from shinmeikai8...
(AJTJapaneseSource) Cannot find entries file: /home/maa/Projects/local-audio-yomichan/plugin/user_files/shinmeikai8_files/index.json
(init_db) Adding entries from forvo...
(init_db) Adding entries from jpod...
(init_db) Adding entries from jpod_alternate...
(init_db) Filling out JMdict forms...
Finished initializing database!
Running local audio server in debug mode...

I realized the detection logic is flawed, as I somehow have anki's aqt package installed as my system package, which is carried over even when I used python -m venv ./venv to create a virtual env for this repo. So the code would always think I'm inside anki and use the wrong directory.

I think introducing a seperate env var WO_ANKI is a good solution (open to better names). It's won't affect the current plugin users. And it won't affect those who already got it working standalone either because it means they don't have aqt installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant