Browse Source

Some Unicode fixes for Python 3

pull/2/head
Noah Petherbridge 4 years ago
parent
commit
ea2ef9876d
3 changed files with 11 additions and 1 deletions
  1. +1
    -1
      rophako/jsondb.py
  2. +5
    -0
      rophako/model/blog.py
  3. +5
    -0
      rophako/modules/blog/__init__.py

+ 1
- 1
rophako/jsondb.py View File

@@ -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
- 0
rophako/model/blog.py View File

@@ -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
- 0
rophako/modules/blog/__init__.py View File

@@ -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