comparison pyink/extensions.py @ 1341:599b606c4669

Start to implement HTML5/CSS3 exporter
author Thinker K.F. Li <thinker@codemud.net>
date Mon, 07 Feb 2011 21:54:03 +0800
parents
children 2d56ed5b0995
comparison
equal deleted inserted replaced
1340:10d5f06f7566 1341:599b606c4669
1 import pybExtension
2 import html5css3
3
4 _all_extensions = [html5css3.extension]
5
6 _DEBUG_FLAG_NAME = 'PYINK_EXT_DBG_ENABLE'
7
8 def _reg_extensions():
9 import os
10
11 if os.environ.has_key(_DEBUG_FLAG_NAME):
12 debug_level = int(os.environ[_DEBUG_FLAG_NAME])
13 else:
14 debug_level = 0
15 pass
16
17 if debug_level > 0:
18 print 'Loading extensions'
19 pass
20
21 for ext_imp, ext_id, ext_name, ioe_name, ioe_items in _all_extensions:
22 if debug_level > 0:
23 print ' register %s -- %s' % (ext_id, ext_name)
24 pass
25
26 #
27 # ioe_items is description items for input, output, and effect.
28 #
29 if ioe_name not in ('input', 'output', 'effect'):
30 raise ValueError, 'invalid extension type (%s)' % (ioe_name)
31
32 kws = {ioe_name: ioe_items}
33 pybExtension.register_extension(ext_imp, ext_id, ext_name, **kws)
34 pass
35 pass
36
37 def initial():
38 _reg_extensions()
39 pass