Skip to content

Commit

Permalink
Resolve minor flake8 issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
TkTech committed Aug 27, 2020
1 parent 8c4dbb9 commit 06d7a9a
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions flask_babel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,10 @@ def __init__(self, translation_directories=None, domain='messages'):
self.cache = {}

def __repr__(self):
return '<Domain({!r}, {!r})>'.format(self._translation_directories, self.domain)
return '<Domain({!r}, {!r})>'.format(
self._translation_directories,
self.domain
)

@property
def translation_directories(self):
Expand Down Expand Up @@ -565,9 +568,9 @@ def get_translations(self):
)
translations.merge(catalog)
# FIXME: Workaround for merge() being really, really stupid. It
# does not copy _info, plural(), or any other instance variables
# populated by GNUTranslations. We probably want to stop using
# `support.Translations.merge` entirely.
# does not copy _info, plural(), or any other instance
# variables populated by GNUTranslations. We probably want to
# stop using `support.Translations.merge` entirely.
if hasattr(catalog, 'plural'):
translations.plural = catalog.plural

Expand Down Expand Up @@ -629,7 +632,7 @@ def lazy_gettext(self, string, **variables):
Example::
hello = lazy_gettext(u'Hello World')
hello = lazy_gettext('Hello World')
@app.route('/')
def index():
Expand All @@ -643,7 +646,11 @@ def lazy_ngettext(self, singular, plural, num, **variables):
Example::
apples = lazy_ngettext(u'%(num)d Apple', u'%(num)d Apples', num=len(apples))
apples = lazy_ngettext(
'%(num)d Apple',
'%(num)d Apples',
num=len(apples)
)
@app.route('/')
def index():
Expand Down Expand Up @@ -687,6 +694,8 @@ def get_domain():
# Create shortcuts for the default Flask domain
def gettext(*args, **kwargs):
return get_domain().gettext(*args, **kwargs)


_ = gettext


Expand Down

0 comments on commit 06d7a9a

Please sign in to comment.