Hello community,
here is the log from the commit of package python-translation-finder for
openSUSE:Factory checked in at 2019-11-08 15:27:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-translation-finder (Old)
and /work/SRC/openSUSE:Factory/.python-translation-finder.new.2990 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-translation-finder"
Fri Nov 8 15:27:49 2019 rev:7 rq:746494 version:1.7
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-translation-finder/python-translation-finder.changes
2019-07-26 12:39:38.809933246 +0200
+++
/work/SRC/openSUSE:Factory/.python-translation-finder.new.2990/python-translation-finder.changes
2019-11-08 15:27:52.635134872 +0100
@@ -1,0 +2,9 @@
+Fri Nov 8 07:49:45 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Update to 1.7 bsc#1142582:
+ * Improved handling of invalid JSON files.
+ * Improved detection of flat JSON files.
+ * Improved compatibility with OSX.
+ * Improved detection of new base with gettext PO files.
+
+-------------------------------------------------------------------
Old:
----
1.6.tar.gz
New:
----
1.7.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-translation-finder.spec ++++++
--- /var/tmp/diff_new_pack.leO30b/_old 2019-11-08 15:27:53.683136050 +0100
+++ /var/tmp/diff_new_pack.leO30b/_new 2019-11-08 15:27:53.687136055 +0100
@@ -20,11 +20,10 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define modname translation-finder
Name: python-translation-finder
-Version: 1.6
+Version: 1.7
Release: 0
Summary: Translation Files Finder
License: GPL-3.0-or-later
-Group: Development/Languages/Python
URL: https://github.com/WeblateOrg/translation-finder
# test_data/linked has to be symlink, hance using github tar ball
Source:
https://github.com/WeblateOrg/translation-finder/archive/%{version}.tar.gz
++++++ 1.6.tar.gz -> 1.7.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/translation-finder-1.6/.drone.yml
new/translation-finder-1.7/.drone.yml
--- old/translation-finder-1.6/.drone.yml 1970-01-01 01:00:00.000000000
+0100
+++ new/translation-finder-1.7/.drone.yml 2019-10-15 08:04:24.000000000
+0200
@@ -0,0 +1,43 @@
+---
+kind: pipeline
+name: python-2
+
+steps:
+- name: test
+ image: python:2
+ commands:
+ - pip install -U -r requirements-test.txt -r requirements-ci.txt
+ - py.test --cov=translation_finder translation_finder README.rst
+ - ./setup.py sdist
+ - twine check dist/*
+ - flake8
+
+---
+kind: pipeline
+name: python-3-5
+
+steps:
+- name: test
+ image: python:3.5
+ commands:
+ - pip install -U -r requirements-test.txt -r requirements-ci.txt
+ - py.test --cov=translation_finder translation_finder README.rst
+ - ./setup.py sdist
+ - twine check dist/*
+ - flake8
+
+---
+kind: pipeline
+name: python-3-7
+
+steps:
+- name: test
+ image: python:3.7
+ commands:
+ - pip install -U -r requirements-test.txt -r requirements-ci.txt
+ - py.test --cov=translation_finder translation_finder README.rst
+ - ./setup.py sdist
+ - twine check dist/*
+ - flake8
+...
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/translation-finder-1.6/.github/workflows/workflow.yml
new/translation-finder-1.7/.github/workflows/workflow.yml
--- old/translation-finder-1.6/.github/workflows/workflow.yml 1970-01-01
01:00:00.000000000 +0100
+++ new/translation-finder-1.7/.github/workflows/workflow.yml 2019-10-15
08:04:24.000000000 +0200
@@ -0,0 +1,31 @@
+name: Python package
+
+on: [push]
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+ strategy:
+ max-parallel: 4
+ matrix:
+ python-version: [2.7, 3.5, 3.6, 3.7]
+
+ steps:
+ - uses: actions/checkout@v1
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v1
+ with:
+ python-version: ${{ matrix.python-version }}
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip wheel
+ pip install -U -r requirements-test.txt -r requirements-ci.txt
+ - name: Lint with flake8
+ run: |
+ pip install flake8
+ flake8
+ - name: Test with pytest
+ run: |
+ pip install pytest
+ py.test --cov=translation_finder translation_finder README.rst
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/translation-finder-1.6/CHANGES.rst
new/translation-finder-1.7/CHANGES.rst
--- old/translation-finder-1.6/CHANGES.rst 2019-06-26 13:35:51.000000000
+0200
+++ new/translation-finder-1.7/CHANGES.rst 2019-10-15 08:04:24.000000000
+0200
@@ -1,6 +1,15 @@
Changelog
=========
+1.7
+---
+
+* Released on 15th October 2019.
+* Improved handling of invalid JSON files.
+* Improved detection of flat JSON files.
+* Improved compatibility with OSX.
+* Improved detection of new base with gettext PO files.
+
1.6
---
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/translation-finder-1.6/README.rst
new/translation-finder-1.7/README.rst
--- old/translation-finder-1.6/README.rst 2019-06-26 13:35:51.000000000
+0200
+++ new/translation-finder-1.7/README.rst 2019-10-15 08:04:24.000000000
+0200
@@ -32,13 +32,13 @@
>>> from pprint import pprint
>>> results = discover('translation_finder/test_data/')
>>> len(results)
- 19
+ 21
>>> pprint(results[0].match)
{'file_format': 'aresource',
'filemask': 'app/src/res/main/values-*/strings.xml',
'name': 'android',
'template': 'app/src/res/main/values/strings.xml'}
- >>> pprint(results[8].match)
+ >>> pprint(results[10].match)
{'file_format': 'po',
'filemask': 'locales/*.po',
'new_base': 'locales/messages.pot'}
@@ -49,7 +49,7 @@
>>> pprint(results[0].meta)
{'discovery': 'TransifexDiscovery', 'origin': 'Transifex', 'priority': 500}
- >>> pprint(results[8].meta)
+ >>> pprint(results[10].meta)
{'discovery': 'GettextDiscovery', 'origin': None, 'priority': 1000}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/translation-finder-1.6/scripts/generate-language-data
new/translation-finder-1.7/scripts/generate-language-data
--- old/translation-finder-1.6/scripts/generate-language-data 2019-06-26
13:35:51.000000000 +0200
+++ new/translation-finder-1.7/scripts/generate-language-data 2019-10-15
08:04:24.000000000 +0200
@@ -83,6 +83,8 @@
"io",
"no",
"nav",
+ "wol",
+ "base",
"source",
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/translation-finder-1.6/translation_finder/__init__.py
new/translation-finder-1.7/translation_finder/__init__.py
--- old/translation-finder-1.6/translation_finder/__init__.py 2019-06-26
13:35:51.000000000 +0200
+++ new/translation-finder-1.7/translation_finder/__init__.py 2019-10-15
08:04:24.000000000 +0200
@@ -26,4 +26,4 @@
from .finder import Finder
__all__ = ("Finder", "discover", "DiscoveryResult")
-__version__ = "1.6"
+__version__ = "1.7"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/translation-finder-1.6/translation_finder/discovery/files.py
new/translation-finder-1.7/translation_finder/discovery/files.py
--- old/translation-finder-1.6/translation_finder/discovery/files.py
2019-06-26 13:35:51.000000000 +0200
+++ new/translation-finder-1.7/translation_finder/discovery/files.py
2019-10-15 08:04:24.000000000 +0200
@@ -52,9 +52,14 @@
def fill_in_new_base(self, result):
super(GettextDiscovery, self).fill_in_new_base(result)
if "new_base" not in result:
- pot_name = result["filemask"].replace("po/*/", "pot/") + "t"
- if self.finder.has_file(pot_name):
- result["new_base"] = pot_name
+ pot_names = [
+ result["filemask"].replace("po/*/", "pot/") + "t",
+ result["filemask"].replace(".*", ""),
+ ]
+ for pot_name in pot_names:
+ if self.finder.has_file(pot_name):
+ result["new_base"] = pot_name
+ break
class QtDiscovery(BaseDiscovery):
@@ -212,7 +217,10 @@
return
with self.finder.open(path, "r") as handle:
- data = json.load(handle)
+ try:
+ data = json.load(handle)
+ except ValueError:
+ return
if not isinstance(data, dict):
return
all_strings = True
@@ -224,7 +232,7 @@
and "description" in value
):
result["file_format"] = "webextension"
- break
+ return
if not isinstance(key, six.string_types) or not isinstance(
value, six.string_types
):
@@ -233,8 +241,11 @@
elif key.endswith("_plural") or "{{" in value:
i18next = True
- if all_strings and i18next:
- result["file_format"] = "i18next"
+ if all_strings:
+ if i18next:
+ result["file_format"] = "i18next"
+ else:
+ result["file_format"] = "json"
class FluentDiscovery(BaseDiscovery):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/translation-finder-1.6/translation_finder/finder.py
new/translation-finder-1.7/translation_finder/finder.py
--- old/translation-finder-1.6/translation_finder/finder.py 2019-06-26
13:35:51.000000000 +0200
+++ new/translation-finder-1.7/translation_finder/finder.py 2019-10-15
08:04:24.000000000 +0200
@@ -34,6 +34,7 @@
".eggs",
"*.swp",
"__pycache__",
+ "__MACOSX",
"test",
"t",
".deps",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/translation-finder-1.6/translation_finder/languages.py
new/translation-finder-1.7/translation_finder/languages.py
--- old/translation-finder-1.6/translation_finder/languages.py 2019-06-26
13:35:51.000000000 +0200
+++ new/translation-finder-1.7/translation_finder/languages.py 2019-10-15
08:04:24.000000000 +0200
@@ -81,7 +81,6 @@
"bam",
"baq",
"bar",
- "base",
"be",
"be@latin",
"be_latn",
@@ -212,6 +211,7 @@
"fj",
"fo",
"fr",
+ "fr_ag",
"fr_be",
"fr_ca",
"fr_ch",
@@ -439,6 +439,7 @@
"orm",
"os",
"oss",
+ "otk",
"pa",
"pan",
"pap",
@@ -473,6 +474,7 @@
"ru",
"ru_r",
"ru_rr",
+ "ru_ua",
"rue",
"rum",
"run",
@@ -488,6 +490,7 @@
"sc",
"scc",
"schinese",
+ "scn",
"sco",
"scr",
"sd",
@@ -616,7 +619,6 @@
"wen",
"wln",
"wo",
- "wol",
"xh",
"xho",
"xog",
@@ -633,9 +635,11 @@
"zh_cn",
"zh_hans",
"zh_hans_cn",
+ "zh_hans_sg",
"zh_hant",
"zh_hant_hk",
"zh_hk",
+ "zh_sg",
"zh_tw",
"zha",
"zho",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/translation-finder-1.6/translation_finder/test_api.py
new/translation-finder-1.7/translation_finder/test_api.py
--- old/translation-finder-1.6/translation_finder/test_api.py 2019-06-26
13:35:51.000000000 +0200
+++ new/translation-finder-1.7/translation_finder/test_api.py 2019-10-15
08:04:24.000000000 +0200
@@ -66,6 +66,11 @@
},
{"file_format": "json-nested", "filemask": "json/bi-*.json"},
{
+ "file_format": "json-nested",
+ "filemask": "json/bom-*.json",
+ "template": "json/bom-en.json",
+ },
+ {
"file_format": "i18next",
"filemask": "json/i18next-*.json",
"template": "json/i18next-en.json",
@@ -81,6 +86,11 @@
"template": "json/webext-en.json",
},
{
+ "file_format": "json",
+ "filemask": "json/flat-*.json",
+ "template": "json/flat-en.json",
+ },
+ {
"filemask": "locales/*.po",
"new_base": "locales/messages.pot",
"file_format": "po",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/translation-finder-1.6/translation_finder/test_data/json/bom-en.json
new/translation-finder-1.7/translation_finder/test_data/json/bom-en.json
--- old/translation-finder-1.6/translation_finder/test_data/json/bom-en.json
1970-01-01 01:00:00.000000000 +0100
+++ new/translation-finder-1.7/translation_finder/test_data/json/bom-en.json
2019-10-15 08:04:24.000000000 +0200
@@ -0,0 +1 @@
+{}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/translation-finder-1.6/translation_finder/test_data/json/flat-en.json
new/translation-finder-1.7/translation_finder/test_data/json/flat-en.json
--- old/translation-finder-1.6/translation_finder/test_data/json/flat-en.json
1970-01-01 01:00:00.000000000 +0100
+++ new/translation-finder-1.7/translation_finder/test_data/json/flat-en.json
2019-10-15 08:04:24.000000000 +0200
@@ -0,0 +1,4 @@
+{
+ "key.1": "value",
+ "key.2": "value"
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/translation-finder-1.6/translation_finder/test_discovery.py
new/translation-finder-1.7/translation_finder/test_discovery.py
--- old/translation-finder-1.6/translation_finder/test_discovery.py
2019-06-26 13:35:51.000000000 +0200
+++ new/translation-finder-1.7/translation_finder/test_discovery.py
2019-10-15 08:04:24.000000000 +0200
@@ -280,6 +280,13 @@
],
)
+ def test_new_base(self):
+ discovery = GettextDiscovery(self.get_finder(["foo.fr.po", "foo.po"]))
+ self.assert_discovery(
+ discovery.discover(),
+ [{"filemask": "foo.*.po", "file_format": "po", "new_base":
"foo.po"}],
+ )
+
class QtTest(DiscoveryTestCase):
def test_basic(self):