diff --git a/CHANGELOG.md b/CHANGELOG.md index cb617f3..a76ab3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,13 @@ +0.0.16 (2019-01-17) +=================== + * Fixed import + + 0.0.15 (2019-01-16) =================== * Added metadata with import date + 0.0.14 (2018-08-07) =================== * Added supporting Django 2.1 diff --git a/transtool/__init__.py b/transtool/__init__.py index c67fea6..c19de90 100644 --- a/transtool/__init__.py +++ b/transtool/__init__.py @@ -1,3 +1,3 @@ -__version__ = '0.0.15' +__version__ = '0.0.16' default_app_config = 'transtool.apps.TrantoolConfig' diff --git a/transtool/management/commands/transtool_import.py b/transtool/management/commands/transtool_import.py index cde7eb5..d8c64df 100644 --- a/transtool/management/commands/transtool_import.py +++ b/transtool/management/commands/transtool_import.py @@ -106,10 +106,12 @@ def copy_files(self, diff_info, imp_zip_file): for fn in sorted(diff_info['new']): content = z.read(fn) po_path = os.path.join(TRANSTOOL_PROJECT_BASE_DIR, fn) + ext = os.path.splitext(po_path)[1] try: with open(po_path, 'wb') as f: f.write(content) - self.update_import_datetime(po_path) + if ext == '.po': + self.update_import_datetime(po_path) except IOError as e: self.stdout.write(e.message) self.stdout.write(' SKIP: {}'.format(fn)) @@ -126,10 +128,12 @@ def copy_files(self, diff_info, imp_zip_file): fn_info = fn content = z.read(fn) po_path = os.path.join(TRANSTOOL_PROJECT_BASE_DIR, fn) + ext = os.path.splitext(po_path)[1] try: with open(po_path, 'wb') as f: f.write(content) - self.update_import_datetime(po_path) + if ext == '.po': + self.update_import_datetime(po_path) except IOError as e: self.stdout.write(e.message) self.stdout.write(' SKIP: {}'.format(fn_info))