Skip to content

Commit

Permalink
Added 'url_unquote' and 'url_unquote_plus' modifiers to DTML as
Browse files Browse the repository at this point in the history
well as made these functions available in PythonScripts via
the 'standard' module.
  • Loading branch information
mcdonc committed Aug 14, 2002
1 parent e60c120 commit a0dd070
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
22 changes: 22 additions & 0 deletions help/standard.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,28 @@ def url_quote_plus(s):
"""

def url_unquote(s):
"""
Convert HTML character entities in strings back to their real values.
See Also
"Python 'urllib'
module":http://www.python.org/doc/current/lib/module-urllib.html
'url_unquote' function.
"""

def url_unquote(s):
"""
Like url_unquote, but also replace '+' characters with spaces.
See Also
"Python 'urllib'
module":http://www.python.org/doc/current/lib/module-urllib.html
'url_unquote_plus' function.
"""

def newline_to_br(s):
"""
Convert newlines and carriage-return and newline combinations to
Expand Down
8 changes: 5 additions & 3 deletions standard.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"import Products.PythonScripts.standard"
"""

__version__='$Revision: 1.7 $'[11:-2]
__version__='$Revision: 1.8 $'[11:-2]

from AccessControl import ModuleSecurityInfo, getSecurityManager
security = ModuleSecurityInfo()
Expand All @@ -27,10 +27,12 @@
'dollars_and_cents', 'structured_text',
'sql_quote', 'html_quote', 'url_quote',
'url_quote_plus', 'newline_to_br',
'thousands_commas')
'thousands_commas', 'url_unquote',
'url_unquote_plus')
from DocumentTemplate.DT_Var import special_formats, \
whole_dollars, dollars_and_cents, structured_text, sql_quote, \
html_quote, url_quote, url_quote_plus, newline_to_br, thousands_commas
html_quote, url_quote, url_quote_plus, newline_to_br, thousands_commas, \
url_unquote, url_unquote_plus

from Globals import HTML
from AccessControl.DTML import RestrictedDTML
Expand Down

0 comments on commit a0dd070

Please sign in to comment.