Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Flask-Babel to 0.9 #9

Merged
merged 5 commits into from
Jan 1, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions main/lib/flask_babel.py → main/lib/flask_babel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Implements i18n/l10n support for Flask applications based on Babel.

:copyright: (c) 2010 by Armin Ronacher.
:copyright: (c) 2013 by Armin Ronacher, Daniel Neuhäuser.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
Expand All @@ -28,6 +28,8 @@
timezone = pytz.timezone
UTC = pytz.UTC

from flask_babel._compat import string_types


class Babel(object):
"""Central controller class that can be used to configure how
Expand Down Expand Up @@ -235,7 +237,7 @@ def get_timezone():
if rv is None:
tzinfo = babel.default_timezone
else:
if isinstance(rv, basestring):
if isinstance(rv, string_types):
tzinfo = timezone(rv)
else:
tzinfo = rv
Expand Down
20 changes: 20 additions & 0 deletions main/lib/flask_babel/_compat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
"""
flask.ext.babel._compat
~~~~~~~~~~~~~~~~~~~~~~~

:copyright: (c) 2013 by Armin Ronacher, Daniel Neuhäuser.
:license: BSD, see LICENSE for more details.
"""
import sys


PY2 = sys.version_info[0] == 2


if PY2:
text_type = unicode
string_types = (str, unicode)
else:
text_type = str
string_types = (str, )