cybertools/meta/README.txt
helmutm c2df42555e work in progress: cybertools.meta package for managing general meta-information, e.g. for configuration settings and preferences
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@2516 fd906abe-77d9-0310-91a1-e0d9ade77398
2008-04-10 16:52:51 +00:00

45 lines
987 B
Text

===========================
Meta Information Management
===========================
($Id$)
Configuration Options, Settings, Preferences
============================================
>>> from cybertools.meta.config import Options
>>> config = Options()
The Options object allows us to access arbitrary attributes that will
be created as elements within the Options object.
>>> config.storage
<AutoElement 'storage'>
>>> config.i18n.languages = ['de', 'en', 'it']
>>> config.i18n.languages
['de', 'en', 'it']
Loading options as Python code
------------------------------
>>> from cybertools.meta.namespace import Executor
>>> config = Options()
>>> ex = Executor(config)
>>> code = """
... controller(names=['cmdline', 'telnet'])
... controller.telnet.port = 5001
... scheduler(name='core')
... logger(name='default', standard=30)
... """
>>> result = ex.execute(code)
>>> config.scheduler.name
'core'
>>> config.logger.standard
30