
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@2516 fd906abe-77d9-0310-91a1-e0d9ade77398
45 lines
987 B
Text
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
|