Skip to content
This repository was archived by the owner on Mar 9, 2021. It is now read-only.

Generate a JSON file as a durable config#34

Open
Victorystick wants to merge 1 commit into
masterfrom
config-file
Open

Generate a JSON file as a durable config#34
Victorystick wants to merge 1 commit into
masterfrom
config-file

Conversation

@Victorystick

@Victorystick Victorystick commented Sep 13, 2017

Copy link
Copy Markdown
Contributor

Don't generate Python code for config that sits alongside the rest of the code. Once the app is bundled á la #33, such files would no longer out live app updates.

Instead, opt for some other format, such as JSON. (Actual format for the config file is up for debate.)

The code converting config.py files to streque.json files is temporary, and can be removed once the active deployments have migrated.

@reinefjord

Copy link
Copy Markdown
Member

such files would no longer out live app updates.

What do you mean by this?

@Victorystick

Copy link
Copy Markdown
Contributor Author

We're dynamically generating new python files in the alge/ directory to hold our config. If the app is bundled into a single executable, there won't any alge'/ directory visible to users. Updating the app would replace the "directory", effectively clearing the config.

Also, I prefer config files that aren't Turing Complete.

@reinefjord

reinefjord commented Sep 14, 2017

Copy link
Copy Markdown
Member

Aight, so the python module/json and where it lives are separate issues. If you want users to do configuration, python's ConfigParser/.ini is a bit easier to write. I've written a short python module function that prints errors in such files: https://github.com/reinefjord/configparser-validator/

This was referenced Sep 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants