Edgewall Software

Opened 17 years ago

Last modified 17 years ago

#123 closed enhancement

Optional disable python code blocks patch — at Version 1

Reported by: fschwindt@… Owned by: cmlenz
Priority: minor Milestone: 0.5
Component: Template processing Version: 0.4
Keywords: python code block patch Cc:

Description (last modified by cmlenz)

Hi,

We're starting to use Genshi at work and we'd like to have a switch to disable python code blocks to avoid any possible misuse and abuse from the content editors.

I've attached the diff (including unittest). It's fairly simple. Passing True to python_disable (yuk, I couldn't think of any other name for it) will raise a TemplateSyntaxError if it encounters such blocks, otherwise the behaviour is the same as the current one.

Are there any chances that this can be included in Genshi, in this or some other form?

Thanks,

f.-

Change History (2)

Changed 17 years ago by fschwindt@…

disable python code blocks

comment:1 Changed 17 years ago by cmlenz

  • Description modified (diff)

Hmm, how about allow_exec=True instead of disable_python=False? Or maybe allow_code_blocks=True, but that's too long IMHO.

The name disable_python is misleading as expressions are also Python.

(I've modified the description to improve readability/formatting)

Note: See TracTickets for help on using tickets.