From: Michael Tremer Date: Tue, 17 Mar 2015 21:59:12 +0000 (+0100) Subject: Fix various errors with newer versions of python X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e46e8df8f5f80d1ebf546ff58c20a2ec262f94c3;p=people%2Fshoehn%2Fipfire.org.git Fix various errors with newer versions of python --- diff --git a/webapp/handlers_rss.py b/webapp/handlers_rss.py index 0f2ac9b..e3755fd 100644 --- a/webapp/handlers_rss.py +++ b/webapp/handlers_rss.py @@ -2,7 +2,6 @@ import logging import textile -import tornado.database import backend @@ -63,9 +62,9 @@ class RSSNewsHandler(RSSHandler): n.author = self.get_account(n.author_id) # Render text - n.text = textile.textile(n.text) + n.text = textile.textile(n.text.decode("utf-8")) - item = tornado.database.Row({ + item = backend.database.Row({ "title" : n.title, "author" : n.author, "published" : n.published, diff --git a/webapp/ui_modules.py b/webapp/ui_modules.py index 433ea68..53b8df2 100644 --- a/webapp/ui_modules.py +++ b/webapp/ui_modules.py @@ -13,8 +13,6 @@ import tornado.locale import tornado.web import unicodedata -from tornado.database import Row - import backend import backend.stasy @@ -129,7 +127,7 @@ class NewsItemModule(UIModule): item.text = item.text[:400] + "..." # Render text - item.text = textile.textile(item.text) + item.text = textile.textile(item.text.decode("utf8")) return self.render_string("modules/news-item.html", item=item, uncut=uncut, announcement=announcement, show_heading=show_heading) @@ -242,7 +240,7 @@ class TrackerPeerListModule(UIModule): peer["hostname"] = "" return self.render_string("modules/tracker-peerlist.html", - peers=[Row(p) for p in peers]) + peers=[backend.database.Row(p) for p in peers]) class StasyTableModule(UIModule): @@ -338,7 +336,7 @@ class StasyGeoTableModule(UIModule): countries = [] for code, value in items: - country = tornado.database.Row({ + country = backend.database.Row({ "code" : code.lower(), "name" : _(self.geoip.get_country_name(code)), "value" : value * 100,