]> git.ipfire.org Git - people/shoehn/ipfire.org.git/commitdiff
Fixes for newer versions of tornado.
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 18 Feb 2013 15:25:27 +0000 (16:25 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 18 Feb 2013 15:25:27 +0000 (16:25 +0100)
templates/modules/ads/download-splash.html
templates/modules/news-item.html
templates/modules/planet-entry.html
templates/planet-posting.html
templates/wishlist/modules/wish.html
templates/wishlist/wish.html
webapp/backend/memcached.py
webapp/handlers_base.py

index ac5c7326493e3d1a62cbeaa71d3138289eff9294..2caf0f2ebbb3c8b32d876b3804f09ea1ff676ec9 100644 (file)
@@ -2,7 +2,8 @@
        <div class="span6 offset3">
                <div class="alert alert-info ac">
                        <strong>{{ _("Advertisement") }}</strong><br>
-                       {{ _("This download is sponsored by %s!") % ad.who }}
+                       {{ _("This download is sponsored by:") }}
+                       {% raw ad.who %}!
                </div>
        </div>
 </div>
index a97410c296a55f9f2f4a899806b49885486e614a..9eb061e020b54c4080e1e2be9240a73347efc545 100644 (file)
@@ -9,7 +9,7 @@
                        </h2>
                {% end %}
 
-               {{ item.text }}
+               {% raw item.text %}
        </div>
 </div>
 <div class="row">
index cdf56f54b41aea286a7d88b8e223cdbf89908e82..6cd520f7a12ee9760cddac51437469068307f897 100644 (file)
@@ -10,7 +10,7 @@
                        <a href="/post/{{ entry.slug }}">{{ entry.title }}</a>
                </h2>
 
-               {{ entry.text }}
+               {% raw entry.text %}
 
                <p class="pull-right" style="clear: both;">
                        {{ _("Posted by") }} <a href="/user/{{ entry.author.uid }}">{{ entry.author.cn }}</a>
index 1637ce99e38b284f3b9c71452b3bd43c919beac7..4c0895008d5be45e9bd3411d36cea15d6e447e4f 100644 (file)
@@ -11,7 +11,7 @@
 
        <div class="row">
                <div class="span9">
-                       {{ entry.text }}
+                       {% raw entry.text %}
                </div>
 
                <p class="pull-right" style="clear: both;">
index ba3326e64a49996a48deb7e0255c1c068fcc35f6..7b8d247ad21c979f9cffc9f5e42ce79e758b82b8 100644 (file)
@@ -11,7 +11,7 @@
                                <a href="/wish/{{ wish.slug }}">{{ escape(wish.title) }}</a>
                        </h3>
 
-                       {{ wish.description }}
+                       {% raw wish.description %}
                        <hr>
                {% end %}
 
@@ -37,7 +37,7 @@
                                                        </div>
 
                                                <div class="span4 ac">
-                                                       <p class="lead">{{ _("%s &euro;") % wish.donated }}</p>
+                                                       <p class="lead">{% raw _("%s &euro;") % wish.donated %}</p>
                                                        <p>{{ _("donated") }}</p>
                                                </div>
 
index ee7fcc5935fa355e37e498e2059203f15fef6fd3..f075963ae9bd5b771190eaed2889ea506756782e 100644 (file)
@@ -9,7 +9,7 @@
 
        {% module Wishlist([wish,], short=True) %}
 
-       {{ wish.description }}
+       {% raw wish.description %}
 
        <hr>
 
index c489d9cb93846eaee91a540fc4a9aff6fbbad6cb..a56b80ee9e1b1a7f806019445a89259a45e704a8 100644 (file)
@@ -14,11 +14,17 @@ class Memcached(object):
 
                self._connection = memcache.Client(hosts, debug=0)
 
-       def get(self, *args, **kwargs):
-               return self._connection.get(*args, **kwargs)
+       def get(self, key, *args, **kwargs):
+               key = str(key)
 
-       def set(self, *args, **kwargs):
-               return self._connection.set(*args, **kwargs)
+               return self._connection.get(key, *args, **kwargs)
 
-       def delete(self, *args, **kwargs):
-               return self._connection.delete(*args, **kwargs)
+       def set(self, key, *args, **kwargs):
+               key = str(key)
+
+               return self._connection.set(key, *args, **kwargs)
+
+       def delete(self, key, *args, **kwargs):
+               key = str(key)
+
+               return self._connection.delete(key, *args, **kwargs)
index 1dde57a39b8b6079636609c6d21dde0c762ae68c..2dce5836d6bff3feca35dcdbe7b9b377624be79a 100644 (file)
@@ -78,16 +78,16 @@ class BaseHandler(tornado.web.RequestHandler):
                kwargs.update(_kwargs)
                return tornado.web.RequestHandler.render_string(self, *args, **kwargs)
 
-       def get_error_html(self, status_code, **kwargs):
+       def write_error(self, status_code, **kwargs):
                if status_code in (404, 500):
                        render_args = ({
                                "code"      : status_code,
                                "exception" : kwargs.get("exception", None),
                                "message"   : httplib.responses[status_code],
                        })
-                       return self.render_string("error-%s.html" % status_code, **render_args)
+                       self.render("error-%s.html" % status_code, **render_args)
                else:
-                       return tornado.web.RequestHandler.get_error_html(self, status_code, **kwargs)
+                       return tornado.web.RequestHandler.write_error(self, status_code, **kwargs)
 
        def static_url(self, path, static=True):
                ret = tornado.web.RequestHandler.static_url(self, path)