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

Changing configuration location #180

Open
carleshf opened this issue Sep 28, 2020 · 1 comment
Open

Changing configuration location #180

carleshf opened this issue Sep 28, 2020 · 1 comment
Labels

Comments

@carleshf
Copy link

Dear all,

I am willing to change the configuration location for bioservices but I do not see how to do it since the class BioServicesConfig allows to change the default but not the path.

¿Recommendations?

Thanks

@cokelaer
Copy link
Owner

Short answer: this is not possible unfortunately.

Long answer: The configuration framework used in bioservices, comes from easydev package where I used the appdirs package itself. This package takes care of dealing with config files directory on different OS platform. In the BioServicesConfig class, it uses easydev.appdirs and the configuration location is a read-only property stored in the attribute settings.appdirs.user_config_dir where settings is the attribute of all bioservices services classes. For instance:

from bioservices import UniProt
u = UniProt()
u.settings.appdirs.user_config_dir

Note that I am changing the API little by little and future version with have the following API:

from bioservices import UniProt
u = UniProt()
u.services.settings.appdirs.user_config_dir

Now, saying that this attribute (user_config_dir) is read-only so you cannot change it. That would required to change easydev package and the module appdirs. Another solution is to create a class that inherits from Appdirs and use it in bioservices.settings. The user_config_path could then be changed as write/read property

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

No branches or pull requests

2 participants