Commits

Olemis Lang  committed 7f74dcc

GViz providers: Fix GViz providers index using Trac=1.0 (formerly broken)

  • Participants
  • Parent commits a517793
  • Branches providers

Comments (0)

Files changed (2)

File trac-dev/gviz/TODO

 X Include helper to convert CSV files under version control to GViz 
   API JSON format.
 
-- Fix GViz providers index, broken using Trac=1.0
+X Fix GViz providers index, broken using Trac=1.0
 
 ~ Write tests for data sources included in TracGViz 1.3.4 that are 
   not about version control.

File trac-dev/gviz/tracgviz/wiki.py

 #   See the License for the specific language governing permissions and
 #   limitations under the License.
 
-r"""This module contains every WikiFirmatting extension being related 
+r"""This module contains every WikiFormatting extension being related 
 to Trac GViz system, as well as data sources that interact with Trac 
 Wiki module.
 
 from trac.wiki.macros import WikiMacroBase
 from trac.wiki.formatter import system_message, wiki_to_html
 
-from genshi.core import Markup
+from genshi.core import Markup, Stream
 from genshi.builder import tag
 from genshi.template import MarkupTemplate
 from pkg_resources import resource_string
               wikifier = lambda text : text
             stream = tmpl.generate(cols=cols, p=provider, docs=docs, \
                                     pdocs=pdocs, dyn=dyn, fmt=wikifier)
-            return stream.render('xhtml')
+            return stream
         except Exception, exc:
             self.log.exception("IG: Generating provider docs ... failed")
             return str(system_message('Could not generate docs for %s' \
                                     'not found'))
             else:
                 providers = gvizsys._cache.itervalues()
-            doc = ''.join(self._provider_doc(p, formatter) \
-                                              for p in providers)
-            return Markup(doc)
+            stream = Stream(chain(self._provider_doc(p, formatter) \
+                    for p in providers))
+            result = sum(stream.serialize('xhtml'))
+            self.log.debug('GViz docs stream %s', repr(result))
+            return Markup(result.unescape())
 
 class GVizTableMacro(WikiMacroBase):
     r"""Render in TracWiki pages the result sets returned by