apertium-apy
apertium-apy copied to clipboard
Better langNames default
Right now, we get a default of langNames.db
. However, a pip install
or Debian install as well now will put it inside /usr/local/share/apertium-apy
. We should use pkg_resources
to guess the correct path (and continue supporting running directly from source). Until then, users will just have to feed it the correct path.
cc @TinoDidriksen
From .deb and .rpm, that would be /usr/share/apertium-apy
without local/
Hopefully pkg_resources
is smart enough to give me the right path. It claims to be.
What I need to do is write a script that runs this code and put langNames in the correct path? Would that solve the issue or I need to do something else?
This issue is about simply choosing a better default here: https://github.com/apertium/apertium-apy/blob/master/apertium_apy/apy.py#L185. (only if the pkg_resources
library is available).
So when a user does pip install on linux, it should automatically feed path to langNames.db?
Ideally, yes. I think there's a function in pkg_resources
that purports to take an installed file and give you the system's actual path.
So what I need to do is set 'default' to some other path instead of langNames.db
What is the function of parse_argument()? How does it work
The Python docs cover that.
Okay I will go through them