Skip to content

Commit

Permalink
add debug_inspect() helper functionw
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed May 14, 2012
1 parent e6ddabb commit b805fa2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ckan/lib/helpers.py
Expand Up @@ -10,6 +10,7 @@
import logging
import re
import urllib
import pprint

from paste.deploy.converters import asbool
from webhelpers.html import escape, HTML, literal, url_escape
Expand Down Expand Up @@ -801,6 +802,10 @@ def include_resource(resource):
r = getattr(html_resources, resource)
r.need()

def debug_inspect(arg):
''' Output pprint.pformat view of supplied arg '''
return literal('<pre>') + pprint.pformat(arg) + literal('</pre>')

# these are the functions that will end up in `h` template helpers
# if config option restrict_template_vars is true
__allowed_functions__ = [
Expand Down Expand Up @@ -866,4 +871,5 @@ def include_resource(resource):
'radio',
'submit',
'asbool',
'debug_inspect',
]

0 comments on commit b805fa2

Please sign in to comment.