# HG changeset patch # User Thinker K.F. Li # Date 1298008973 -28800 # Node ID aa7cbf2cbf34ceb4337efa6b7b72bb7ca9cb92fc # Parent a05ea7fa43ec5cc170c38220198dc4aef7e7b8f8 Fix bug of SVG been fault for showing diff -r a05ea7fa43ec -r aa7cbf2cbf34 pyink/html5css3.py --- a/pyink/html5css3.py Fri Feb 18 10:37:44 2011 +0800 +++ b/pyink/html5css3.py Fri Feb 18 14:02:53 2011 +0800 @@ -120,6 +120,11 @@ pass def _print_node_open(node, lvl, out): + node_name = node.name() + if node_name.startswith('svg:'): + node_name = node_name[4:] + pass + attrs = [] for attrname in node.allAttributes(): attrvalue = node.getAttribute(attrname) @@ -129,19 +134,29 @@ if attrs: attrs_str = ' '.join(attrs) - line = '<%s %s>' % (node.name(), attrs_str) + line = '<%s %s>' % (node_name, attrs_str) else: - line = '<%s>' % (node.name()) + line = '<%s>' % (node_name) pass _print_level(line, lvl, out) pass def _print_node_close(node, lvl, out): - line = '' % (node.name()) + node_name = node.name() + if node_name.startswith('svg:'): + node_name = node_name[4:] + pass + + line = '' % (node_name) _print_level(line, lvl, out) pass def _print_node_single(node, lvl, out): + node_name = node.name() + if node_name.startswith('svg:'): + node_name = node_name[4:] + pass + attrs = [] for attrname in node.allAttributes(): attrvalue = node.getAttribute(attrname) @@ -151,9 +166,9 @@ if attrs: attrs_str = ' '.join(attrs) - line = '<%s %s/>' % (node.name(), attrs_str) + line = '<%s %s/>' % (node_name, attrs_str) else: - line = '<%s/>' % (node.name()) + line = '<%s/>' % (node_name) pass _print_level(line, lvl, out) pass @@ -269,13 +284,42 @@ self._parser = parser parser.start_handle(doc.rdoc) - print parser._maxframe - print doc.rdoc.root().allAttributes() - print parser.all_comp_names() - print 'save to ' + filename + self._handle_transition_layers() + + out = file(filename, 'w+') + print >> out, '''\ + + +Scribboo Test Page + + + +''' + + root = doc.rdoc.root() + _print_subtree(root, 1, out) + + print >> out, '''\ + +''' + + out.close() pass ## \brief Find all animation pairs.