Browse Source

Test if title is already unicode.

pull/136/head
Simon Conseil 11 years ago
parent
commit
dbc92d136d
  1. 4
      sigal/settings.py
  2. 2
      tests/sample/sigal.conf.py

4
sigal/settings.py

@ -27,7 +27,7 @@ import os
from os.path import abspath, isabs, join, normpath
from pprint import pformat
from .compat import PY2
from .compat import PY2, text_type
_DEFAULT_CONFIG = {
@ -141,7 +141,7 @@ def read_settings(filename=None):
if PY2 and isinstance(settings[p], str):
settings[p] = settings[p].decode(enc)
if settings['title']:
if settings['title'] and not isinstance(settings['title'], text_type):
settings['title'] = settings['title'].decode('utf8')
for key in ('img_size', 'thumb_size', 'video_size'):

2
tests/sample/sigal.conf.py

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
title = "Sigal test gallery ☺"
title = u"Sigal test gallery ☺"
source = 'pictures'
thumb_suffix = '.tn'
thumb_size = (200, 150)

Loading…
Cancel
Save