Skip to main content
Help improve PyPI by participating in a 5-minute user interface survey!

configurable - Class integration with config files

Project Description

Allows attributes of classes and/or instances to be set directly through config
files. Config file example followed by code:

[sect1]
foo=bar

[Klass]
prop1=qwe
prop2=456
prop3=false

[SubKlass]
hihi = HEHE
------------------------
class Klass(Configurable):
class SubKlass(Configurable):
config = Config(hihi = "hoho")
config = Config(
prop1="asd",
prop2=123,
prop3=True
)
assert Klass.config.prop1 == "asd"
assert Klass.config.prop2 == 123
assert Klass.config.prop3 == True
assert Klass.SubKlass.config.hihi == "hoho"
c = ConfigFile(path, globals())
assert Klass.config.prop1 == "qwe"
assert Klass.config.prop2 == 456
assert Klass.config.prop3 == False
assert c.Klass.prop1 == "qwe"
assert c.Klass.prop2 == "456"
assert c.Klass.prop3 == "false"

Release history Release notifications

This version
History Node

0.1dev

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
configurable-0.1dev.tar.gz (4.3 kB) Copy SHA256 hash SHA256 Source None Jul 29, 2009

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page