mozilla / active-data-recipes

A repository of various activedata queries and recipes
Mozilla Public License 2.0
9 stars 24 forks source link

Add Configuration object #44

Closed TrangNguyenBC closed 6 years ago

TrangNguyenBC commented 6 years ago

Hi @ahal, I am sorry I did something wrong when rebasing from upstream, causing the old pull request disappeared. I followed you guide: using __slots__ to limit number of properties, move config file to adr package, also edit MANIFEST.in to include these files. Also, making barebone Configuration with these __slots__ properties without loading config file; it would be easier to use in testing. Some other minor changes: Remove entry point for adr-query, re-format test.py to run tox successfully. Thank you!

TrangNguyenBC commented 6 years ago

And I also run python setup.py install then adr inspect and it run normally. Please let me know if there is something need to be changed. Thanks.

TrangNguyenBC commented 6 years ago

Hi @ahal I updated my commit with two changes:

ahal commented 6 years ago
* for default value handling, I only put `None` to those keys missing in `config.yml` file. Do you think we need to set hard code default value for specific missing keys, like `setattr(self, "url", "http://..)`?

I think None is fine for now since the config.yml is hardcoded into the repo. Though maybe in the future we'll want to look for config.yml in the user's home directory and hard code the defaults right into the Configuration class.. but this is fine for now as there should never be a key missing.