Skip to content
Myr

Normalize to styleguide

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent c299ff1 · Browse files · 1 file+7 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+7 added−5 removed

  • other:+7 added−5 removed

1 file+7 added−5 removed

modified:jinja2/filters.py+7 added-5 removed
68 unmodified lines
69 if hasattr(value, '__html__'):70 value = value.__html__()71 return escape(unicode(value))727374def do_urlescape(value):75 """Escape strings for use in URLs (uses UTF-8 encoding)."""76 def utf8(o):77 return unicode(o).encode('utf8')77 7879 if isinstance(value, basestring):80 return urllib.quote(utf8(value))80 8182 if hasattr(value, 'items'):83 # convert dictionaries to list of 2-tuples84 value = value.items()84 8586 if hasattr(value, 'next'):87 # convert generators to list88 value = list(value)88 89 return urllib.urlencode([(utf8(k), utf8(v)) for (k, v) in value])8990 return urllib.urlencode((utf8(k), utf8(v)) for (k, v) in value)919293@evalcontextfilter94def do_replace(eval_ctx, s, old, new, count=None):95 """Return a copy of the value with all occurrences of a substring96 replaced with a new one. The first argument is the substring
726 unmodified lines