def mako_websafe(text=''): if text.__class__ == _Unsafe: return text elif isinstance(text, Templated): return _Unsafe(text.render()) elif isinstance(text, CacheStub): return _Unsafe(text) elif text is None: return "" elif text.__class__ != unicode: text = _force_unicode(text) return c_websafe(text)
def mako_websafe(text = ''): if text.__class__ == _Unsafe: return text elif isinstance(text, Templated): return _Unsafe(text.render()) elif isinstance(text, CacheStub): return _Unsafe(text) elif text is None: return "" elif text.__class__ != unicode: text = _force_unicode(text) return c_websafe(text)
def conditional_websafe(text=''): from wrapped import Templated, CacheStub if text.__class__ == _Unsafe: return text elif isinstance(text, Templated): return _Unsafe(text.render()) elif isinstance(text, CacheStub): return _Unsafe(text) elif text is None: return "" elif text.__class__ != unicode: text = _force_unicode(text) return c_websafe(text)
def conditional_websafe(text = ''): from wrapped import Templated, CacheStub if text.__class__ == _Unsafe: return text elif isinstance(text, Templated): return _Unsafe(text.render()) elif isinstance(text, CacheStub): return _Unsafe(text) elif text is None: return "" elif text.__class__ != unicode: text = _force_unicode(text) return c_websafe(text)
def websafe(text=''): if text.__class__ != unicode: text = _force_unicode(text) #wrap the response in _Unsafe so make_websafe doesn't unescape it return _Unsafe(c_websafe(text))
def websafe(text=''): if text.__class__ == _Unsafe: return text elif text.__class__ != unicode: text = _force_unicode(text) return c_websafe(text)