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

Refactor config to use single-class tree model #5

Open
c1de0x opened this issue May 1, 2012 · 1 comment
Open

Refactor config to use single-class tree model #5

c1de0x opened this issue May 1, 2012 · 1 comment
Assignees

Comments

@c1de0x
Copy link
Contributor

c1de0x commented May 1, 2012

Refactor the config mechanism to use a single-class based tree model.

The class should allow

  • serialization/deserialization of the config tree to/from files
  • path based (dot and slash delimited) attribute lookup
  • 'duck typing' (non-schema values)
  • automagic python attribute lookup
  • a 'reconfigure' event, which allows subscribers to 'see' what changed, and perform actions based on the changes (e.g. modify backlog limits on the fly).
  • automatically fall back to attribute values in parent configs if a value is undefined at the current path level.
  • pretty print function

Perhaps the root of the tree should be global, although it'd probably be best if the root was injected into anything needing access to config data. One root per user, or one root with user children?

@c1de0x
Copy link
Contributor Author

c1de0x commented May 6, 2012

In a6c80f4, a basic Config object which implements:

  • serialization/deserialization using yaml
  • path based attribute lookup (/ or .)
  • automagic python attribute lookup
  • duck-typing
  • attribute gets fall through to the first defined value in the hierarchy. Maybe this should be optional (through a special method?)
  • prettyish print function

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

No branches or pull requests

1 participant