Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #2008 (closed enhancement: fixed)

Opened 11 years ago

Last modified 11 years ago

[PATCH] Turbogears does not support genshi.new_text_syntax option

Reported by: kikidonk Owned by: faide
Priority: high Milestone: 1.1b2
Component: TurboGears Version: 1.0 HEAD
Severity: normal Keywords: genshi, needs patch, needs tests
Cc:

Description

Genshi>=0.5 supports a config option genshi.new_text_syntax (=0 by default) to determine whether to use the old or new text template syntax.

There is currently no way to pass that option to the genshi template plugin.

turbogears/view/base.py should be patched to add to engine_options dict the following line:

"genshi.new_text_syntax" : get("genshi.new_text_syntax", False),

Attachments

tg-genshi-new-text-syntax.diff Download (676 bytes) - added by kikidonk 11 years ago.
Add the genshi.new_text_syntax option to view/base.py engine loaders

Change History

comment:1 Changed 11 years ago by mramm

We can add this.

But you CAN use the new text syntax by using the new renderer_genshi function and setting it up however you want.

Also, I'm a bit confused by your suggested change, as I don't think it will run. Do you mean config.get("genshi.new_text_syntax", False) ?

comment:2 Changed 11 years ago by mramm

Oops, sorry I thought this was intended as a tg2 ticket, but now I see it's a 1.1 issue. So you can ignore the bit about using the new render functions.

comment:3 Changed 11 years ago by Chris Arndt

  • Keywords genshi, needs patch, needs tests added; genshi removed

Can you give a link to where this feature and the new syntax are documented, so it is easier to write a test case?

Even better, if you provide a patch and test case yourself, we'll happily include this asap.

comment:4 Changed 11 years ago by kikidonk

Here is the description of that feature:  http://genshi.edgewall.org/wiki/Documentation/0.5.x/plugin.html#genshi-new-text-syntax

I attach the patch to turbogears.view.base for 1.1 svn version, but it needs to be applied for 1.0.x as well.

Changed 11 years ago by kikidonk

Add the genshi.new_text_syntax option to view/base.py engine loaders

comment:5 Changed 11 years ago by faide

  • Milestone changed from 1.1 to 1.1 beta 2
  • Summary changed from Turbogears does not support genshi.new_text_syntax option to [PATCH] Turbogears does not support genshi.new_text_syntax option

comment:6 Changed 11 years ago by faide

  • Type changed from defect to enhancement

comment:7 Changed 11 years ago by faide

applied to r5737 thanks.

comment:8 Changed 11 years ago by Chris Arndt

Still needs tests and documentation.

comment:9 Changed 11 years ago by faide

Yep that's why I did not close this. I wanted your input on how we could test this.

comment:10 Changed 11 years ago by Chris Arndt

Add a method to turbogears.tests.test_view.TestView, which calls view.load_engines() sets the tg.defaultview and genshi.new_text_syntax config options (saving the current values first) and renders a text template using view.render(), restores the config settings, calls view.load_engines() again to reset the state, and then asserts the output is correct.

comment:11 Changed 11 years ago by faide

  • Status changed from new to closed
  • Resolution set to fixed

Added tests in r5791

Note: See TracTickets for help on using tickets.