Browse Source

Some Unicode fixes for Python 3

pull/2/head
Noah Petherbridge 6 years ago
parent
commit
ea2ef9876d
  1. 2
      rophako/jsondb.py
  2. 5
      rophako/model/blog.py
  3. 5
      rophako/modules/blog/__init__.py

2
rophako/jsondb.py

@ -188,7 +188,7 @@ def write_json(path, data):
flock(fh, LOCK_EX)
# Write it.
fh.write(json.dumps(data, sort_keys=True, indent=4, separators=(',', ': ')))
fh.write(json.dumps(data, indent=4, separators=(',', ': ')))
# Unlock and close.
flock(fh, LOCK_UN)

5
rophako/model/blog.py

@ -8,6 +8,11 @@ import time
import re
import glob
import os
import sys
if sys.version_info[0] > 2:
def unicode(s):
return s
from rophako.settings import Config
import rophako.jsondb as JsonDB

5
rophako/modules/blog/__init__.py

@ -19,6 +19,11 @@ from rophako.plugin import load_plugin
from rophako.settings import Config
from rophako.log import logger
import sys
if sys.version_info[0] > 2:
def unicode(s):
return str(s)
mod = Blueprint("blog", __name__, url_prefix="/blog")
load_plugin("rophako.modules.comment")

Loading…
Cancel
Save