openfisca / openfisca-web-api

[DEPRECATED] Web API for OpenFisca
https://www.openfisca.fr/
GNU Affero General Public License v3.0
13 stars 11 forks source link

Fix country path in development mode #96

Closed cbenz closed 7 years ago

cbenz commented 7 years ago

Bugfix: in development mode (with paster serve), fix the path of the country package.

This impacts the parameters endpoint.

Before:

{"xml_file_path": "penfisca/openfisca_france/parameters/__root__.xml"}

xml_file_path is intended to be relative of the directory of the Python package (ie /home/.../openfisca-france/openfisca_france).

Its value should be:

{"xml_file_path": "parameters/__root__.xml"}

This is the fix: getting the absolute path of the country package directory helps finding the relative path of the XML file (which is an absolute path).