Skip to content

Commit

Permalink
import fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bubenkoff committed Mar 4, 2014
1 parent c9f77e2 commit 3510d25
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
/README.html
/.hg
/.hgignore
/.Python
2 changes: 1 addition & 1 deletion traduki/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def get_text_from_dict(mydict, code=None, chain=None):
return get_text_from_dict(mydict, code, chain)

# nothing helped, falling back to just values of the dict provided
return next(_dict.values(), None)
return next(iter(_dict.values()), None)


def get_ordered_languages():
Expand Down
6 changes: 3 additions & 3 deletions traduki/sqla.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def get_dict(self):

def get_text(self, code=None, chain=None):
"""Get the text for specified language code.
Delegates to :py:func:`LocalizedString.get_text_from_dict`, with all the given arguments and
Delegates to :py:func:`traduki.helpers.get_text_from_dict`, with all the given arguments and
a dictionary, representing this :py:class:`Translation`.
The dictionary is created using :py:func:`get_dict`.
Expand Down Expand Up @@ -106,7 +106,7 @@ def _do_compare(self, op, other, escape):
Looking into the the next language if the given language is not filled in.
"""
related = self.property.mapper.class_
cols = [getattr(related, lang) for lang in helpers.ordered_languages() if hasattr(related, lang)]
cols = [getattr(related, lang) for lang in helpers.get_ordered_languages() if hasattr(related, lang)]
return self.has(op(func.coalesce(*cols), other, escape=escape))


Expand Down Expand Up @@ -137,7 +137,7 @@ def set(state, value, oldvalue, initiator):
if oldvalue is None:
return Translation(**value_dict)
else:
for lang in helpers.ordered_languages():
for lang in helpers.get_ordered_languages():
setattr(oldvalue, lang, value_dict.get(lang))

return oldvalue
Expand Down

0 comments on commit 3510d25

Please sign in to comment.