apertium-apy icon indicating copy to clipboard operation
apertium-apy copied to clipboard

Better langNames default

Open sushain97 opened this issue 6 years ago • 10 comments

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

sushain97 avatar Apr 05 '18 16:04 sushain97

From .deb and .rpm, that would be /usr/share/apertium-apy without local/

TinoDidriksen avatar Apr 05 '18 16:04 TinoDidriksen

Hopefully pkg_resources is smart enough to give me the right path. It claims to be.

sushain97 avatar Apr 05 '18 16:04 sushain97

whatsapp image 2019-03-04 at 9 48 18 pm 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?

ayushjainrksh avatar Mar 04 '19 16:03 ayushjainrksh

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).

sushain97 avatar Mar 05 '19 03:03 sushain97

So when a user does pip install on linux, it should automatically feed path to langNames.db?

ayushjainrksh avatar Mar 05 '19 18:03 ayushjainrksh

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.

sushain97 avatar Mar 05 '19 19:03 sushain97

So what I need to do is set 'default' to some other path instead of langNames.db

ayushjainrksh avatar Mar 05 '19 19:03 ayushjainrksh

What is the function of parse_argument()? How does it work

ayushjainrksh avatar Mar 05 '19 19:03 ayushjainrksh

The Python docs cover that.

sushain97 avatar Mar 05 '19 19:03 sushain97

Okay I will go through them

ayushjainrksh avatar Mar 05 '19 19:03 ayushjainrksh