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

Generate a JSON file as a durable config #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Victorystick
Copy link
Contributor

@Victorystick Victorystick commented Sep 13, 2017

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
Member

such files would no longer out live app updates.

What do you mean by this?

@Victorystick
Copy link
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
Copy link
Member

reinefjord commented Sep 14, 2017

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