progrium / ginkgo

Python service microframework
http://ginkgo.readthedocs.org
MIT License
325 stars 48 forks source link

Group should be/act as dict #55

Closed progrium closed 12 years ago

progrium commented 12 years ago

As well its current interface, Group should be able to be used as a read-only dict. This way you can pass a config group into another framework as a dict quite easily:

logfile = "/var/log/foo.log"

class flask:
    debug = False
    testing = True
    secret_key = "woifh28fhw93fh"

Then in your app, setting up flask:

app.config.update(settings.group('flask'))
progrium commented 12 years ago

https://github.com/progrium/ginkgo/commit/bd56102b4fc69a4b9a6c130c7f350a11db488cef