From 7b2dcb3cf645d625a48cfe0e822bc4a8dcfe67bb Mon Sep 17 00:00:00 2001 From: Keith Mitchell Date: Thu, 18 Oct 2012 14:32:32 -0700 Subject: [PATCH] Remove unused utility/template_helpers alternatives to query_string --- r2/r2/lib/filters.py | 7 ------- r2/r2/lib/template_helpers.py | 6 ------ r2/r2/templates/comment.html | 2 +- r2/r2/templates/message.html | 2 +- r2/r2/templates/profilebar.html | 2 +- 5 files changed, 3 insertions(+), 16 deletions(-) diff --git a/r2/r2/lib/filters.py b/r2/r2/lib/filters.py index 09cc9abef..a8a02e8e3 100644 --- a/r2/r2/lib/filters.py +++ b/r2/r2/lib/filters.py @@ -132,13 +132,6 @@ def websafe(text=''): #wrap the response in _Unsafe so make_websafe doesn't unescape it return _Unsafe(c_websafe(text)) -from mako.filters import url_escape -def edit_comment_filter(text = ''): - try: - text = unicode(text, 'utf-8') - except TypeError: - text = unicode(text) - return url_escape(text) valid_link_schemes = ( '/', diff --git a/r2/r2/lib/template_helpers.py b/r2/r2/lib/template_helpers.py index c4ddd25fc..70a27202a 100755 --- a/r2/r2/lib/template_helpers.py +++ b/r2/r2/lib/template_helpers.py @@ -27,7 +27,6 @@ from r2.lib.utils import vote_hash, UrlParser, timesince, is_subdomain from r2.lib.media import s3_direct_url import babel.numbers -from mako.filters import url_escape import simplejson import os.path from copy import copy @@ -148,11 +147,6 @@ def js_config(): } return config -def generateurl(context, path, **kw): - if kw: - return path + '?' + '&'.join(["%s=%s"%(k, url_escape(v)) \ - for k, v in kw.iteritems() if v]) - return path def class_dict(): t_cls = [Link, Comment, Message, Subreddit] diff --git a/r2/r2/templates/comment.html b/r2/r2/templates/comment.html index ea5856fa7..2046966af 100755 --- a/r2/r2/templates/comment.html +++ b/r2/r2/templates/comment.html @@ -21,7 +21,7 @@ ############################################################################### <%! - from r2.lib.filters import edit_comment_filter, unsafe + from r2.lib.filters import unsafe from r2.lib.pages.things import CommentButtons from r2.lib.pages import WrappedUser %> diff --git a/r2/r2/templates/message.html b/r2/r2/templates/message.html index abb2fb0d2..d9da8a7c4 100644 --- a/r2/r2/templates/message.html +++ b/r2/r2/templates/message.html @@ -21,7 +21,7 @@ ############################################################################### <%! - from r2.lib.filters import edit_comment_filter, safemarkdown + from r2.lib.filters import safemarkdown from r2.lib.pages.things import MessageButtons from r2.lib.pages import WrappedUser %> diff --git a/r2/r2/templates/profilebar.html b/r2/r2/templates/profilebar.html index 9e0996c05..c3cdd2214 100644 --- a/r2/r2/templates/profilebar.html +++ b/r2/r2/templates/profilebar.html @@ -21,7 +21,7 @@ ############################################################################### <%! - from r2.lib.filters import edit_comment_filter, unsafe, safemarkdown + from r2.lib.filters import unsafe, safemarkdown from r2.lib.template_helpers import static, format_number %> <%namespace file="utils.html" import="submit_form, plain_link, thing_timestamp"/>