[odrs-web] Make compatible with python2 again



commit e5013e1db5620e1f74043cbe4b38553ebcc83da7
Author: Richard Hughes <richard hughsie com>
Date:   Mon Sep 26 14:16:13 2016 +0100

    Make compatible with python2 again

 README.md   |    5 +++++
 admin.py    |    6 +++---
 flaskapp.py |    2 +-
 3 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/README.md b/README.md
index e0dbebc..7461fbb 100644
--- a/README.md
+++ b/README.md
@@ -35,6 +35,11 @@ can be used on the new instance.
 
 ## How to I use distro packages ##
 
+    pkcon install python2-PyMySQL python-flask python-flask-wtf \
+      python-flask-login
+
+...or, if you're using python3:
+
     pkcon install python3-PyMySQL python3-flask python3-flask-wtf \
       python3-flask-login
 
diff --git a/admin.py b/admin.py
index b5c5bc6..0797956 100644
--- a/admin.py
+++ b/admin.py
@@ -174,15 +174,15 @@ def utility_processor():
         nr_stars = int(rating / 20)
         tmp = ''
         for i in range(0, nr_stars):
-            tmp += '★'
+            tmp += u'★'
         for i in range(0, 5 - nr_stars):
-            tmp += '☆'
+            tmp += u'☆'
         return tmp
 
     def format_truncate(tmp, length):
         if len(tmp) <= length:
             return tmp
-        return tmp[:length] + '…'
+        return tmp[:length] + u'…'
 
     def format_timestamp(tmp):
         if not tmp:
diff --git a/flaskapp.py b/flaskapp.py
index e5621a1..9875626 100755
--- a/flaskapp.py
+++ b/flaskapp.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/python2
 # -*- coding: utf-8 -*-
 #
 # Copyright (C) 2016 Richard Hughes <richard hughsie com>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]