Skip to content

Commit

Permalink
Fixed import
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Melnyk committed Feb 1, 2019
1 parent 3ffc17e commit 444f5f4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
0.0.17 (2019-02-01)
===================
* Fixed import


0.0.16 (2019-01-17)
===================
* Fixed import
Expand Down
2 changes: 1 addition & 1 deletion transtool/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = '0.0.16'
__version__ = '0.0.17'

default_app_config = 'transtool.apps.TrantoolConfig'
17 changes: 7 additions & 10 deletions transtool/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import re
import polib
from django.utils.encoding import force_str
from django.utils import timezone


Expand All @@ -27,16 +28,12 @@ def get_lc_files_list(search_root, exts=('.po', '.mo')):
def get_diff_po(po1_fn, po2_fn):
po1_lines = []
po2_lines = []
for entry in sorted(polib.pofile(po1_fn), key=lambda obj: obj.msgid):
po1_lines.append((
u'msgid {}\n\n'
u'msgstr {}\n\n'
).format(entry.msgid, entry.msgstr))
for entry in sorted(polib.pofile(po2_fn), key=lambda obj: obj.msgid):
po2_lines.append((
u'msgid {}\n\n'
u'msgstr {}\n\n'
).format(entry.msgid, entry.msgstr))
for entry in sorted(polib.pofile(po1_fn, wrapwidth=8000), key=lambda obj: obj.msgid):
entry.occurrences.clear()
po1_lines.append(force_str(entry))
for entry in sorted(polib.pofile(po2_fn, wrapwidth=8000), key=lambda obj: obj.msgid):
entry.occurrences.clear()
po2_lines.append(force_str(entry))
added = removed = 0
for diff_line in difflib.unified_diff(po1_lines, po2_lines):
if diff_line.startswith('+++ ') or diff_line.startswith('--- ') or diff_line.startswith('@@ '):
Expand Down

0 comments on commit 444f5f4

Please sign in to comment.