cybertools/meta
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
..
__init__.py create cybertools.meta package for managing configuration options and other meta and control data 2008-04-10 13:29:06 +00:00
config.py work in progress: cybertools.meta package for managing general meta-information, e.g. for configuration settings and preferences 2008-04-10 16:52:51 +00:00
element.py work in progress: cybertools.meta package for managing general meta-information, e.g. for configuration settings and preferences 2008-04-10 16:52:51 +00:00
interfaces.py create cybertools.meta package for managing configuration options and other meta and control data 2008-04-10 13:29:06 +00:00
namespace.py work in progress: cybertools.meta package for managing general meta-information, e.g. for configuration settings and preferences 2008-04-10 16:52:51 +00:00
namespace.txt work in progress: cybertools.meta package for managing general meta-information, e.g. for configuration settings and preferences 2008-04-10 16:52:51 +00:00
README.txt work in progress: cybertools.meta package for managing general meta-information, e.g. for configuration settings and preferences 2008-04-10 16:52:51 +00:00
tests.py work in progress: cybertools.meta package for managing general meta-information, e.g. for configuration settings and preferences 2008-04-10 16:52:51 +00:00

===========================
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