]> git.ipfire.org Git - people/shoehn/ipfire.org.git/commitdiff
Fix various errors with newer versions of python
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 17 Mar 2015 21:59:12 +0000 (22:59 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 17 Mar 2015 21:59:12 +0000 (22:59 +0100)
webapp/handlers_rss.py
webapp/ui_modules.py

index 0f2ac9b1e772292dbf785ded0023b4e607a38c31..e3755fdfab04a479cdc409141ae8a9e912be2519 100644 (file)
@@ -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,
index 433ea68ca2a9fdf85c0dc66c30cd3ff6e6d8ebbc..53b8df239f0fb73e7ce9d5d2c51e24b727fc1421 100644 (file)
@@ -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,