Mercurial > MadButterfly
view pyink/extensions.py @ 1342:972d749b9656
Move component_manager to a separated object.
- component_manager is a mixin for domview.
- domview inherit component_manager to mixing-in component_manager.
- There is no boundary between component_manager and domview, hard
to be managed and reused.
- component_manager is a separated object that hold a reference to
corresponding domview.
- domview delegate attribute accessing to component_manager object to
expose attributes and methods of component_manager. (__getattr__())
- component_manager is still a mix-in of domview.
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Tue, 08 Feb 2011 13:05:07 +0800 |
parents | 599b606c4669 |
children | 2d56ed5b0995 |
line wrap: on
line source
import pybExtension import html5css3 _all_extensions = [html5css3.extension] _DEBUG_FLAG_NAME = 'PYINK_EXT_DBG_ENABLE' def _reg_extensions(): import os if os.environ.has_key(_DEBUG_FLAG_NAME): debug_level = int(os.environ[_DEBUG_FLAG_NAME]) else: debug_level = 0 pass if debug_level > 0: print 'Loading extensions' pass for ext_imp, ext_id, ext_name, ioe_name, ioe_items in _all_extensions: if debug_level > 0: print ' register %s -- %s' % (ext_id, ext_name) pass # # ioe_items is description items for input, output, and effect. # if ioe_name not in ('input', 'output', 'effect'): raise ValueError, 'invalid extension type (%s)' % (ioe_name) kws = {ioe_name: ioe_items} pybExtension.register_extension(ext_imp, ext_id, ext_name, **kws) pass pass def initial(): _reg_extensions() pass