Dan
Dan

Reputation: 3725

Genshi - how to print out all variables in scope

Quite simply I'd like to print out all variables that are in scope in my genshi template, as a debugging and discovery measure. Is there a way to do it?

Upvotes: 2

Views: 769

Answers (1)

Chris Boyle
Chris Boyle

Reputation: 11551

The standard Python function locals() (which returns a dict) works for me. I'm using Genshi 0.5.1, and as you'll see, everything seems to be in __data__.

${repr(locals())}

Upvotes: 3

Related Questions