Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-cron-descriptor for openSUSE:Factory checked in at 2022-12-03 10:03:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-cron-descriptor (Old) and /work/SRC/openSUSE:Factory/.python-cron-descriptor.new.1835 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-cron-descriptor" Sat Dec 3 10:03:57 2022 rev:4 rq:1039741 version:1.2.32 Changes: -------- --- /work/SRC/openSUSE:Factory/python-cron-descriptor/python-cron-descriptor.changes 2022-09-27 20:14:57.005960856 +0200 +++ /work/SRC/openSUSE:Factory/.python-cron-descriptor.new.1835/python-cron-descriptor.changes 2022-12-03 10:04:10.743421179 +0100 @@ -1,0 +2,9 @@ +Sat Dec 3 04:28:06 UTC 2022 - Yogalakshmi Arunachalam <yarunacha...@suse.com> + +- Update to v1.2.32 + * chore(Format): fix formatting + +- Update to v1.2.31 + No changelog + +------------------------------------------------------------------- Old: ---- cron_descriptor-1.2.31.tar.gz New: ---- cron_descriptor-1.2.32.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-cron-descriptor.spec ++++++ --- /var/tmp/diff_new_pack.zRsafW/_old 2022-12-03 10:04:11.151423446 +0100 +++ /var/tmp/diff_new_pack.zRsafW/_new 2022-12-03 10:04:11.155423469 +0100 @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-cron-descriptor -Version: 1.2.31 +Version: 1.2.32 Release: 0 Summary: Python library that converts cron expressions into human readable strings License: MIT ++++++ cron_descriptor-1.2.31.tar.gz -> cron_descriptor-1.2.32.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cron-descriptor-1.2.31/archlinux/PKGBUILD new/cron-descriptor-1.2.32/archlinux/PKGBUILD --- old/cron-descriptor-1.2.31/archlinux/PKGBUILD 2022-07-10 11:26:36.000000000 +0200 +++ new/cron-descriptor-1.2.32/archlinux/PKGBUILD 2022-11-15 20:11:02.000000000 +0100 @@ -1,5 +1,5 @@ pkgname=python-cron-descriptor -pkgver=1.2.31 +pkgver=1.2.32 pkgdesc="A Python library that converts cron expressions into human readable strings." pkgrel=1 arch=('any') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cron-descriptor-1.2.31/cron_descriptor/ExpressionDescriptor.py new/cron-descriptor-1.2.32/cron_descriptor/ExpressionDescriptor.py --- old/cron-descriptor-1.2.31/cron_descriptor/ExpressionDescriptor.py 2022-07-10 11:26:36.000000000 +0200 +++ new/cron-descriptor-1.2.32/cron_descriptor/ExpressionDescriptor.py 2022-11-15 20:11:02.000000000 +0100 @@ -120,7 +120,7 @@ Returns: The FULL description Raises: - FormatException: if formating fails and throw_exception_on_parse_error is True + FormatException: if formatting fails and throw_exception_on_parse_error is True """ @@ -142,7 +142,8 @@ description = ExpressionDescriptor.transform_case(description, self._options.casing_type) except Exception: description = self._( - "An error occurred when generating the expression description. Check the cron expression syntax.") + "An error occurred when generating the expression description. Check the cron expression syntax." + ) if self._options.throw_exception_on_parse_error: raise FormatException(description) @@ -553,7 +554,7 @@ minute_expression, second_expression='' ): - """Given time parts, will contruct a formatted time description + """Given time parts, will construct a formatted time description Args: hour_expression: Hours part minute_expression: Minutes part diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cron-descriptor-1.2.31/cron_descriptor/__init__.py new/cron-descriptor-1.2.32/cron_descriptor/__init__.py --- old/cron-descriptor-1.2.31/cron_descriptor/__init__.py 2022-07-10 11:26:36.000000000 +0200 +++ new/cron-descriptor-1.2.32/cron_descriptor/__init__.py 2022-11-15 20:11:02.000000000 +0100 @@ -27,6 +27,6 @@ from .Exception import MissingFieldException, FormatException, WrongArgumentException -__version__ = '1.2.31' +__version__ = '1.2.32' __all__ = ['Options', 'ExpressionDescriptor', 'get_description', 'DescriptionTypeEnum', 'CasingTypeEnum', 'MissingFieldException', 'FormatException', 'WrongArgumentException'] Binary files old/cron-descriptor-1.2.31/cron_descriptor/locale/nl_NL.mo and new/cron-descriptor-1.2.32/cron_descriptor/locale/nl_NL.mo differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cron-descriptor-1.2.31/cron_descriptor/locale/nl_NL.po new/cron-descriptor-1.2.32/cron_descriptor/locale/nl_NL.po --- old/cron-descriptor-1.2.31/cron_descriptor/locale/nl_NL.po 2022-07-10 11:26:36.000000000 +0200 +++ new/cron-descriptor-1.2.32/cron_descriptor/locale/nl_NL.po 2022-11-15 20:11:02.000000000 +0100 @@ -26,7 +26,7 @@ #: ExpressionDescriptor.py:151 msgid "At " -msgstr "Op " +msgstr "Om " #: ExpressionDescriptor.py:160 #, python-brace-format @@ -35,7 +35,7 @@ #: ExpressionDescriptor.py:165 msgid "At" -msgstr "Op" +msgstr "Om" #: ExpressionDescriptor.py:175 msgid " and" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cron-descriptor-1.2.31/setup.py new/cron-descriptor-1.2.32/setup.py --- old/cron-descriptor-1.2.31/setup.py 2022-07-10 11:26:36.000000000 +0200 +++ new/cron-descriptor-1.2.32/setup.py 2022-11-15 20:11:02.000000000 +0100 @@ -32,7 +32,7 @@ setuptools.setup( name="cron_descriptor", - version="1.2.31", + version="1.2.32", description="A Python library that converts cron expressions " "into human readable strings.", author="Adam Schubert", @@ -53,9 +53,6 @@ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.5", - "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", @@ -69,6 +66,11 @@ "Programming Language :: Python :: 3.10", "Topic :: Software Development", ], + extras_require={ + 'dev': [ + 'polib', + ] + }, tests_require=[ 'pep8', 'flake8', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cron-descriptor-1.2.31/tools/resx2dict.py new/cron-descriptor-1.2.32/tools/resx2dict.py --- old/cron-descriptor-1.2.31/tools/resx2dict.py 2022-07-10 11:26:36.000000000 +0200 +++ new/cron-descriptor-1.2.32/tools/resx2dict.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,33 +0,0 @@ -# The MIT License (MIT) -# -# Copyright (c) 2016 Adam Schubert -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -import xml.etree.ElementTree as ET - - -def resx2dict(resx): - tree = ET.parse(resx) - root = tree.getroot() - translation_table = {} - for first in root.findall('./data'): - translation_table[first.attrib['name']] = first.find('./value').text - - return translation_table diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cron-descriptor-1.2.31/tools/resx2po.py new/cron-descriptor-1.2.32/tools/resx2po.py --- old/cron-descriptor-1.2.31/tools/resx2po.py 2022-07-10 11:26:36.000000000 +0200 +++ new/cron-descriptor-1.2.32/tools/resx2po.py 2022-11-15 20:11:02.000000000 +0100 @@ -19,72 +19,100 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +import datetime -from resx2dict import resx2dict -import os +import xml.etree.ElementTree as ET +from pathlib import Path import polib -import shutil -class resx2po(object): - """ - Converts resx to po and mo, it is using template.po file to keep file.py:line_number info - """ - def __init__(self, resxen2name, resxlocale, potemplate, out_path, code): - if os.path.isfile(resxen2name) is False: - raise Exception("Resx bound not found") - - if os.path.isfile(resxlocale) is False: - raise Exception("Resx trans not found") - - if os.path.isfile(potemplate) is False: - raise Exception("PO template not found") - - bound = resx2dict(resxen2name) - trans = resx2dict(resxlocale) - - motable = {} - for boundk in sorted(bound, key=len, reverse=True): - if boundk in trans: - motable[bound[boundk]] = trans[boundk] - else: - print("WARNING: {} not found in {}, wont be added into motable".format(boundk, resxen2name)) - - po = polib.pofile(potemplate) - +class Resx2Po: + def __init__(self, en_resx: Path, translation_resx: Path, code: str, output_po: Path): + if not en_resx.is_file(): + raise Exception("EN Resx {} not found".format(en_resx.absolute())) + + if not translation_resx.is_file(): + raise Exception("Translation {} {} Resx bound not found".format(code, translation_resx.absolute())) + + self.en_resx = self.resx2dict(en_resx) + self.translation_resx = self.resx2dict(translation_resx) + self.code = code + self.output_po = output_po + + self.generate() + + def resx2dict(self, resx): + tree = ET.parse(resx) + root = tree.getroot() + translation_table = {} + for first in root.findall('./data'): + translation_table[first.attrib['name']] = first.find('./value').text + + return translation_table + + def generate(self): + po = polib.POFile() + now = datetime.datetime.now(datetime.timezone.utc) po.metadata = { 'Project-Id-Version': '1.0', 'Report-Msgid-Bugs-To': 'adam.schub...@sg1-game.net', - 'POT-Creation-Date': '2016-01-19 02:00+0100', - 'PO-Revision-Date': '2016-01-19 02:00+0100', + 'POT-Creation-Date': now.strftime("%Y-%m-%d %H:%M%z"), + 'PO-Revision-Date': now.strftime("%Y-%m-%d %H:%M%z"), 'Last-Translator': 'Adam Schubert <adam.schub...@sg1-game.net>', 'Language-Team': '', 'MIME-Version': '1.0', 'Content-Type': 'text/plain; charset=utf-8', 'Content-Transfer-Encoding': '8bit', - 'Language': code + 'Language': self.code } - for entry in po: - if entry.msgid in motable: - entry.msgstr = motable[entry.msgid] + + for message_en_id, message_en in self.en_resx.items(): + if message_en_id in self.translation_resx: + entry = polib.POEntry( + msgid=message_en, + msgstr=self.translation_resx[message_en_id], + comment=message_en_id + ) + po.append(entry) else: - print("WARNING: {} not found in {}".format(entry.msgid, 'motable')) + print('WARNING: {} not found in {} resx'.format(message_en_id, self.code)) + + po.save(str(self.output_po.absolute())) + + +code_list = { + 'da': 'da_DK', - po.save() - po.save_as_mofile(os.path.join(out_path, '{}.mo'.format(code))) - shutil.copy2(potemplate, os.path.join(out_path, '{}.po'.format(code))) - - -directory = '../locale' -resx2po('Resources.resx', 'Resources.de.resx', 'messages.po', directory, 'de_DE') -resx2po('Resources.resx', 'Resources.es.resx', 'messages.po', directory, 'es_ES') -resx2po('Resources.resx', 'Resources.fr.resx', 'messages.po', directory, 'fr_FR') -resx2po('Resources.resx', 'Resources.it.resx', 'messages.po', directory, 'it_IT') -resx2po('Resources.resx', 'Resources.nl.resx', 'messages.po', directory, 'nl_NL') -resx2po('Resources.resx', 'Resources.no.resx', 'messages.po', directory, 'nb_NO') -resx2po('Resources.resx', 'Resources.pt.resx', 'messages.po', directory, 'pt_PT') -resx2po('Resources.resx', 'Resources.ru.resx', 'messages.po', directory, 'ru_RU') -resx2po('Resources.resx', 'Resources.tr.resx', 'messages.po', directory, 'tr_TR') -resx2po('Resources.resx', 'Resources.uk.resx', 'messages.po', directory, 'uk_UA') -resx2po('Resources.resx', 'Resources.zh-CHS.resx', 'messages.po', directory, 'zh_CN') -resx2po('Resources.resx', 'Resources.ta.resx', 'messages.po', directory, 'ta_IN') \ No newline at end of file + # 'de': 'de_DE', + # 'es': 'es_ES', + # 'es-MX': 'es_MX', + # 'fa': 'fa_IR', + # 'fi': 'fi_FI', + # 'fr': 'fr_FR', + # 'it': 'it_IT', + # 'ja': 'ja_IP', + # 'ko': 'ko_KR', + # 'nb': 'nb_NO', + # 'nl': 'nl_NL', + # 'pl': 'pl_PL', + # 'pt': 'pt_PT', + # 'ro': 'ro_RO', + # 'ru': 'ru_RU', + # 'sl': 'sl_SI', + # 'sv': 'sv_SE', + # 'tr': 'tr_TR', + # 'uk': 'uk_UA', + # 'zh-Hans': 'zh_Hans_CN', + # 'zh-Hant': 'zh_Hant', +} + +output_dir = Path('../locale') + +for from_code, to_code in code_list.items(): + output_file = output_dir.joinpath('{}.po'.format(to_code)) + Resx2Po( + Path('Resources.resx'), + Path('Resources.{}.resx'.format(from_code)), + to_code, + output_file + ) \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cron-descriptor-1.2.31/tools/shit2gettext.py new/cron-descriptor-1.2.32/tools/shit2gettext.py --- old/cron-descriptor-1.2.31/tools/shit2gettext.py 2022-07-10 11:26:36.000000000 +0200 +++ new/cron-descriptor-1.2.32/tools/shit2gettext.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,49 +0,0 @@ -# The MIT License (MIT) -# -# Copyright (c) 2016 Adam Schubert -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -from resx2dict import resx2dict -import os - - -class Shit2gettext(object): - def __init__(self, resx, pyfile, pyfileo, resclasspath): - if os.path.isfile(resx) is False: - raise Exception("Resx file not found") - - if os.path.isfile(pyfile) is False: - raise Exception("Pyfile not found") - - table = resx2dict(resx) - - f = open(pyfile,'r') - filedata = f.read() - f.close() - - for key in sorted(table, key=len, reverse=True): - filedata = filedata.replace("{}.{}".format('.'.join(resclasspath), key), '_("{}")'.format(table[key])) - - f = open(pyfileo + '.new' if pyfileo == pyfile else pyfileo,'w') - f.write(filedata) - f.close() - - -Shit2gettext('Resources.resx', '../cron_descriptor/ExpressionDescriptor.py.resx','../cron_descriptor/ExpressionDescriptor.py', ['Resources'])