Hello community, here is the log from the commit of package i18nspector for openSUSE:Factory checked in at 2014-03-23 22:32:52 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/i18nspector (Old) and /work/SRC/openSUSE:Factory/.i18nspector.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "i18nspector" Changes: -------- --- /work/SRC/openSUSE:Factory/i18nspector/i18nspector.changes 2014-01-29 07:14:44.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.i18nspector.new/i18nspector.changes 2014-03-23 22:34:09.000000000 +0100 @@ -1,0 +2,13 @@ +Thu Mar 20 16:57:19 UTC 2014 - lazy.k...@opensuse.org + +- Update to 0.13.4. + * Regenerate the timezone information file using tzdata 2014a. + * Recognize “8859-n” (without the “ISO-” prefix) as encoding + names. + * Recognize *.local, *.in-addr.arpa and *.ip6.arpa as special + domain names. + * Fix compatibility with polib 1.0.4. + * Improve the test suite. +- Update keyring. + +------------------------------------------------------------------- Old: ---- i18nspector-0.13.3.tar.gz i18nspector-0.13.3.tar.gz.asc New: ---- i18nspector-0.13.4.tar.gz i18nspector-0.13.4.tar.gz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ i18nspector.spec ++++++ --- /var/tmp/diff_new_pack.jQW9pt/_old 2014-03-23 22:34:09.000000000 +0100 +++ /var/tmp/diff_new_pack.jQW9pt/_new 2014-03-23 22:34:09.000000000 +0100 @@ -17,7 +17,7 @@ Name: i18nspector -Version: 0.13.3 +Version: 0.13.4 Release: 0 Summary: Tool for Checking gettext POT/PO/MO Files License: MIT ++++++ i18nspector-0.13.3.tar.gz -> i18nspector-0.13.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.13.3/.coveragerc new/i18nspector-0.13.4/.coveragerc --- old/i18nspector-0.13.3/.coveragerc 2014-01-20 20:04:40.000000000 +0100 +++ new/i18nspector-0.13.4/.coveragerc 2014-03-20 13:55:22.000000000 +0100 @@ -1,6 +1,6 @@ [report] exclude_lines = - \s+raise misc.DataIntegrityError\b + \s+raise misc[.]DataIntegrityError\b \s+raise NotImplementedError\b <no-coverage> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.13.3/data/header-fields new/i18nspector-0.13.4/data/header-fields --- old/i18nspector-0.13.3/data/header-fields 2014-01-20 20:04:40.000000000 +0100 +++ new/i18nspector-0.13.4/data/header-fields 2014-03-20 13:55:22.000000000 +0100 @@ -3,7 +3,7 @@ # # The following string extraction tools have been used: # * pygettext.py (xgettext for Python) 1.5 -# * xgettext (GNU gettext-tools) 0.18.1 +# * xgettext (GNU gettext-tools) 0.18.3 Content-Transfer-Encoding Content-Type diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.13.3/data/iso-codes new/i18nspector-0.13.4/data/iso-codes --- old/i18nspector-0.13.3/data/iso-codes 2014-01-20 20:04:40.000000000 +0100 +++ new/i18nspector-0.13.4/data/iso-codes 2014-03-20 13:55:22.000000000 +0100 @@ -1,7 +1,7 @@ # This file has been generated automatically by private/update-iso-codes. # Do not edit. -# iso-codes version: 3.49 -# Last update: 2013-12-06 +# iso-codes version: 3.51 +# Last update: 2014-03-20 [language-codes] aar = aa diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.13.3/data/timezones new/i18nspector-0.13.4/data/timezones --- old/i18nspector-0.13.3/data/timezones 2014-01-20 20:04:40.000000000 +0100 +++ new/i18nspector-0.13.4/data/timezones 2014-03-20 13:55:22.000000000 +0100 @@ -1,6 +1,6 @@ # This file has been generated automatically by private/update-timezones. # Do not edit. -# Last update: 2013-07-01 +# Last update: 2014-03-20 [timezones] ACT = -0500 @@ -42,7 +42,6 @@ CHOST = +1000 CHOT = +0800 +0900 CHUT = +1000 -CIT = +0800 CKT = -1000 CLST = -0300 CLT = -0400 @@ -63,7 +62,6 @@ EET = +0200 EGST = +0000 EGT = -0100 -EIT = +0900 EST = +1000 +1100 -0500 FET = +0300 FJST = +1300 @@ -206,7 +204,9 @@ WFT = +1200 WGST = -0200 WGT = -0300 -WIT = +0700 +WIB = +0700 +WIT = +0900 +WITA = +0800 WSDT = +1400 -1000 WST = +0800 +0900 +1300 -1100 YAKST = +1000 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.13.3/doc/changelog new/i18nspector-0.13.4/doc/changelog --- old/i18nspector-0.13.3/doc/changelog 2014-01-20 20:04:40.000000000 +0100 +++ new/i18nspector-0.13.4/doc/changelog 2014-03-20 13:55:22.000000000 +0100 @@ -1,3 +1,14 @@ +i18nspector (0.13.4) unstable; urgency=low + + * Regenerate the timezone information file using tzdata 2014a. + * Recognize “8859-n” (without the “ISO-” prefix) as encoding names. + * Recognize *.local, *.in-addr.arpa and *.ip6.arpa as special domain names. + * Fix compatibility with polib 1.0.4. + http://bugs.debian.org/742162 + * Improve the test suite. + + -- Jakub Wilk <jw...@jwilk.net> Thu, 20 Mar 2014 13:54:53 +0100 + i18nspector (0.13.3) unstable; urgency=low * Fix incorrect plural expression co-domain evaluation. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.13.3/doc/i18nspector.1 new/i18nspector-0.13.4/doc/i18nspector.1 --- old/i18nspector-0.13.3/doc/i18nspector.1 2014-01-20 20:04:44.000000000 +0100 +++ new/i18nspector-0.13.4/doc/i18nspector.1 2014-03-20 13:55:23.000000000 +0100 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH I18NSPECTOR 1 "2014-01-20" "i18nspector 0.13.3" "" +.TH I18NSPECTOR 1 "2014-03-20" "i18nspector 0.13.4" "" .SH NAME i18nspector \- checking tool for gettext POT, PO and MO files . diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.13.3/doc/i18nspector.txt new/i18nspector-0.13.4/doc/i18nspector.txt --- old/i18nspector-0.13.3/doc/i18nspector.txt 2014-01-20 20:04:40.000000000 +0100 +++ new/i18nspector-0.13.4/doc/i18nspector.txt 2014-03-20 13:55:22.000000000 +0100 @@ -7,7 +7,7 @@ ---------------------------------------------- :manual section: 1 -:version: i18nspector 0.13.3 +:version: i18nspector 0.13.4 :date: |date| Synopsis diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.13.3/doc/todo.txt new/i18nspector-0.13.4/doc/todo.txt --- old/i18nspector-0.13.3/doc/todo.txt 2014-01-20 20:04:40.000000000 +0100 +++ new/i18nspector-0.13.4/doc/todo.txt 2014-03-20 13:55:22.000000000 +0100 @@ -103,10 +103,6 @@ * http://sources.debian.net/data/main/m/mtpaint/3.40-1/po/de.po * http://sources.debian.net/data/main/y/yaboot-installer/1.1.26/debian/po/hi.po -Correct encoding ``8859-``\ *n* → ``ISO-8859-``\ *n*. Test-case: - - * http://sources.debian.net/data/main/v/vnc4/4.1.1+X4.3.0-37.1/unix/xc/extras/FreeType/po/nl.po - Split missing-timezone-in-date from invalid-date. Check for non-ASCII (translated?) project id. Test-case: @@ -156,10 +152,4 @@ * http://sources.debian.net/src/evolution/3.4.4-3/shell/main.c#L579 -Recognize more special-use domain names: - - * http://www.iana.org/assignments/special-use-domain-names/special-use-domain-names.xhtml - * http://tools.ietf.org/html/rfc6761 - * http://tools.ietf.org/html/rfc6762 - .. vim:ft=rst diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.13.3/lib/checker.py new/i18nspector-0.13.4/lib/checker.py --- old/i18nspector-0.13.3/lib/checker.py 2014-01-20 20:04:40.000000000 +0100 +++ new/i18nspector-0.13.4/lib/checker.py 2014-03-20 13:55:22.000000000 +0100 @@ -38,7 +38,7 @@ from . import ling from . import misc from . import polib4us -from . import rfc2606 +from . import domains from . import tags class EnvironmentNotPatched(RuntimeError): @@ -597,7 +597,7 @@ uri = urllib.parse.urlparse(report_msgid_bugs_to) if uri.scheme == '': self.tag('invalid-report-msgid-bugs-to', report_msgid_bugs_to) - elif rfc2606.is_reserved_email(email_address): + elif domains.is_email_in_special_domain(email_address): self.tag('invalid-report-msgid-bugs-to', report_msgid_bugs_to) elif email_address == 'EMAIL@ADDRESS': self.tag('boilerplate-in-report-msgid-bugs-to', report_msgid_bugs_to) @@ -617,7 +617,7 @@ translator_emails.add(translator_email) if '@' not in translator_email: self.tag('invalid-last-translator', translator) - elif rfc2606.is_reserved_email(translator_email): + elif domains.is_email_in_special_domain(translator_email): self.tag('invalid-last-translator', translator) elif translator_email == 'EMAIL@ADDRESS': if not is_template: @@ -635,7 +635,7 @@ # TODO: An URL is also allowed here. # self.tag('invalid-language-team', translator) pass - elif rfc2606.is_reserved_email(team_email): + elif domains.is_email_in_special_domain(team_email): self.tag('invalid-language-team', team) elif team_email in {'l...@li.org', 'EMAIL@ADDRESS'}: if not is_template: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.13.3/lib/cli.py new/i18nspector-0.13.4/lib/cli.py --- old/i18nspector-0.13.3/lib/cli.py 2014-01-20 20:04:40.000000000 +0100 +++ new/i18nspector-0.13.4/lib/cli.py 2014-03-20 13:55:22.000000000 +0100 @@ -37,7 +37,7 @@ from . import tags from . import terminal -__version__ = '0.13.3' +__version__ = '0.13.4' def initialize_terminal(): if sys.stdout.isatty(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.13.3/lib/domains.py new/i18nspector-0.13.4/lib/domains.py --- old/i18nspector-0.13.3/lib/domains.py 1970-01-01 01:00:00.000000000 +0100 +++ new/i18nspector-0.13.4/lib/domains.py 2014-03-20 13:55:22.000000000 +0100 @@ -0,0 +1,55 @@ +# Copyright © 2013, 2014 Jakub Wilk <jw...@jwilk.net> +# +# 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. + +''' +special-use domain names +''' + +# http://www.iana.org/assignments/special-use-domain-names/special-use-domain-names.xhtml + +import re + +_regexps = [ + # RFC 1035, §3.5 <http://tools.ietf.org/html/rfc1035#section-3.5>: + '.+[.]in-addr[.]arpa', + # RFC 3596, §2.5 <http://tools.ietf.org/html/rfc3596#section-2.5>: + '.+[.]ip6[.]arpa', + # RFC 6761, §6 <http://tools.ietf.org/html/rfc6761#section-6>: + '(.+[.])?test', + '(.+[.])?localhost', + '(.+[.])?invalid', + '(.+[.])?example([.](com|net|org))?', + # RFC 6762, §3 <http://tools.ietf.org/html/rfc6762#section-3>: + '(.+[.])local', +] + +_is_special = re.compile( + '^({re})$'.format(re='|'.join(_regexps)) +).match + +def is_special_domain(domain): + domain = domain.lower() + return _is_special(domain) + +def is_email_in_special_domain(email): + _, domain = email.rsplit('@', 1) + return is_special_domain(domain) + +# vim:ts=4 sw=4 et diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.13.3/lib/encodings.py new/i18nspector-0.13.4/lib/encodings.py --- old/i18nspector-0.13.3/lib/encodings.py 2014-01-20 20:04:40.000000000 +0100 +++ new/i18nspector-0.13.4/lib/encodings.py 2014-03-20 13:55:22.000000000 +0100 @@ -25,7 +25,7 @@ import codecs import configparser -import contextlib +import encodings.aliases as encoding_aliases import errno import functools import itertools @@ -214,6 +214,10 @@ @functools.lru_cache(maxsize=1) def install_extra_encodings(): codecs.register(_codec_search_function) + for enc_name in _portable_encodings: + if enc_name.startswith('iso-'): + suffix = enc_name[4:].replace('-', '_') + encoding_aliases.aliases.setdefault(suffix, 'iso' + suffix) def get_character_name(ch): try: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.13.3/lib/polib4us.py new/i18nspector-0.13.4/lib/polib4us.py --- old/i18nspector-0.13.3/lib/polib4us.py 2014-01-20 20:04:40.000000000 +0100 +++ new/i18nspector-0.13.4/lib/polib4us.py 2014-03-20 13:55:22.000000000 +0100 @@ -1,4 +1,4 @@ -# Copyright © 2012, 2013 Jakub Wilk <jw...@jwilk.net> +# Copyright © 2012, 2013, 2014 Jakub Wilk <jw...@jwilk.net> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the “Software”), to deal @@ -59,6 +59,7 @@ # - newline decoding: http://bugs.debian.org/692283 # - trailing comment parsing: https://bitbucket.org/izi/polib/issue/51 # - atypical comment parsing +# - parsing of empty files: https://bitbucket.org/izi/polib/issue/59 class Codecs(object): @@ -69,7 +70,7 @@ return getattr(codecs, attr) def open(self, path, mode, encoding): - if mode != 'rU': + if mode not in {'rU', 'rt'}: raise NotImplementedError if not encodings.is_ascii_compatible_encoding(encoding): encoding = 'ASCII' @@ -77,6 +78,7 @@ contents = file.read() contents = contents.decode(encoding) pending_comments = [] + empty = True for line in self._iterlines(contents): if self._atypical_comment(line): line = '# ' + line[1:] @@ -87,10 +89,13 @@ yield comment_line pending_comments = [] yield line + empty = False + if empty: + yield '# ' @register_patch def codecs_patch(): - polib.codecs = Codecs() + polib.codecs = polib.io = Codecs() # polib.POFile.find() # =================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.13.3/lib/rfc2606.py new/i18nspector-0.13.4/lib/rfc2606.py --- old/i18nspector-0.13.3/lib/rfc2606.py 2014-01-20 20:04:40.000000000 +0100 +++ new/i18nspector-0.13.4/lib/rfc2606.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,46 +0,0 @@ -# Copyright © 2013, 2014 Jakub Wilk <jw...@jwilk.net> -# -# 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. - -''' -RFC 2606: Reserved Top Level DNS Names -''' - -# http://tools.ietf.org/search/rfc2606 - -import re - -_is_reserved = re.compile(r''' -( [.] test -| [.] example -| [.] invalid -| [.] localhost -| (^|[.])example[.](com|net|org) -) $ -''', re.VERBOSE).search - -def is_reserved_domain(domain): - domain = domain.lower() - return _is_reserved(domain) - -def is_reserved_email(email): - _, domain = email.rsplit('@', 1) - return is_reserved_domain(domain) - -# vim:ts=4 sw=4 et diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.13.3/private/update-header-fields new/i18nspector-0.13.4/private/update-header-fields --- old/i18nspector-0.13.3/private/update-header-fields 2014-01-20 20:04:40.000000000 +0100 +++ new/i18nspector-0.13.4/private/update-header-fields 2014-03-20 13:55:22.000000000 +0100 @@ -1,6 +1,6 @@ #!/usr/bin/python3 -# Copyright © 2012, 2013 Jakub Wilk <jw...@jwilk.net> +# Copyright © 2012, 2013, 2014 Jakub Wilk <jw...@jwilk.net> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the “Software”), to deal @@ -22,8 +22,8 @@ import os import shutil -import tempfile import subprocess as ipc +import tempfile xgettexts = {'xgettext', 'pygettext'} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.13.3/private/update-iso-codes new/i18nspector-0.13.4/private/update-iso-codes --- old/i18nspector-0.13.3/private/update-iso-codes 2014-01-20 20:04:40.000000000 +0100 +++ new/i18nspector-0.13.4/private/update-iso-codes 2014-03-20 13:55:22.000000000 +0100 @@ -1,6 +1,6 @@ #!/usr/bin/python3 -# Copyright © 2012, 2013 Jakub Wilk <jw...@jwilk.net> +# Copyright © 2012, 2013, 2014 Jakub Wilk <jw...@jwilk.net> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the “Software”), to deal @@ -20,9 +20,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -import collections -import functools import datetime +import functools import os import subprocess as ipc import sys @@ -107,7 +106,7 @@ raise Panic('unknown scope: {!r}'.format(scope)) status = element.get('status') if status == 'Active': - major = True + pass elif status == 'Retired': continue else: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.13.3/private/update-line-coverage new/i18nspector-0.13.4/private/update-line-coverage --- old/i18nspector-0.13.3/private/update-line-coverage 2014-01-20 20:04:40.000000000 +0100 +++ new/i18nspector-0.13.4/private/update-line-coverage 2014-03-20 13:55:22.000000000 +0100 @@ -20,13 +20,12 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -import os import glob -import sys import io +import os +import sys import nose -import nose.core import nose.plugins.cover class Coverage(nose.plugins.cover.Coverage): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.13.3/tests/blackbox_tests/__init__.py new/i18nspector-0.13.4/tests/blackbox_tests/__init__.py --- old/i18nspector-0.13.3/tests/blackbox_tests/__init__.py 2014-01-20 20:04:40.000000000 +0100 +++ new/i18nspector-0.13.4/tests/blackbox_tests/__init__.py 2014-03-20 13:55:22.000000000 +0100 @@ -46,7 +46,7 @@ # ---------------------------------------- -_parse_etag = re.compile('# ([A-Z]): (([\w-]+).*)').match +_parse_etag = re.compile('([A-Z]): (([\w-]+).*)').match def parse_etag(contents, path, multi_line=False): match = _parse_etag(contents) @@ -221,50 +221,65 @@ elif expected_failure: raise AssertionError('unexpected success') -def _test_file(path): - path = os.path.relpath(os.path.join(here, path), start=os.getcwd()) - options = [] +class TestFileSyntaxError(Exception): + pass + +def _parse_test_header_file(file, path, *, comments_only): etags = [] - try: - file = open(path + '.gen', encoding='ASCII', errors='ignore') - except IOError as exc: - if exc.errno == errno.ENOENT: - file = open(path, 'rt', encoding='ASCII', errors='ignore') - else: - raise - with file: - for n, line in enumerate(file): + options = [] + for n, line in enumerate(file): + orig_line = line + if comments_only: if n == 0 and line.startswith('#!'): continue - if not line.startswith('# '): + if line.startswith('# '): + line = line[2:] + else: break + if line.startswith('--'): + options += shlex.split(line) + else: etag = parse_etag(line, path) if etag is None: - if line.startswith('# --'): - options += shlex.split(line[2:]) - continue - break + if comments_only: + break + else: + raise TestFileSyntaxError(orig_line) etags += [etag] - assert_emit_tags(path, etags, options=options) + return etags, options -def get_coverage_for_file(path): +def _parse_test_headers(path): + # <path>.tags: + try: + file = open(path + '.tags', encoding='ASCII') + except IOError as exc: + if exc.errno != errno.ENOENT: + raise + else: + with file: + return _parse_test_header_file(file, path, comments_only=False) + # <path>.gen: try: file = open(path + '.gen', encoding='ASCII', errors='ignore') except IOError as exc: - if exc.errno == errno.ENOENT: - file = open(path, 'rt', encoding='ASCII', errors='ignore') - else: + if exc.errno != errno.ENOENT: raise - with file: - for n, line in enumerate(file): - if n == 0 and line.startswith('#!'): - continue - if not line.startswith('# '): - break - etag = parse_etag(line, '') - if etag is None: - continue - yield etag.tag + else: + with file: + return _parse_test_header_file(file, path, comments_only=True) + # <path>: + with open(path, 'rt', encoding='ASCII', errors='ignore') as file: + return _parse_test_header_file(file, path, comments_only=True) + +def _test_file(path): + path = os.path.relpath(os.path.join(here, path), start=os.getcwd()) + options = [] + etags, options = _parse_test_headers(path) + assert_emit_tags(path, etags, options=options) + +def get_coverage_for_file(path): + etags, options = _parse_test_headers(path) + return (t.tag for t in etags) def get_coverage_for_function(fn): for etag in etags_from_tagstring(fn, ''): @@ -283,7 +298,7 @@ yield _test_file, path @tagstring(''' -# E: os-error No such file or directory +E: os-error No such file or directory ''') def test_os_error_no_such_file(): with aux.temporary_directory() as tmpdir: @@ -292,7 +307,7 @@ assert_emit_tags(path, expected) @tagstring(''' -# E: os-error Permission denied +E: os-error Permission denied ''') def test_os_error_permission_denied(): if os.getuid() == 0: @@ -305,17 +320,6 @@ expected = etags_from_tagstring(this(), path) assert_emit_tags(path, expected) -@tagstring(''' -# E: invalid-mo-file unexpected magic -''') -def test_empty_mo_file(): - with aux.temporary_directory() as tmpdir: - path = os.path.join(tmpdir, 'empty-mo-file.mo') - with open(path, 'wb'): - pass - expected = etags_from_tagstring(this(), path) - assert_emit_tags(path, expected) - # ---------------------------------------- def get_coverage(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.13.3/tests/blackbox_tests/generated-by-field.po new/i18nspector-0.13.4/tests/blackbox_tests/generated-by-field.po --- old/i18nspector-0.13.3/tests/blackbox_tests/generated-by-field.po 2014-01-20 20:04:40.000000000 +0100 +++ new/i18nspector-0.13.4/tests/blackbox_tests/generated-by-field.po 2014-03-20 13:55:22.000000000 +0100 @@ -1,4 +1,4 @@ -# The Generated-By is field is not not used or generated by any of the GNU +# The Generated-By field is not not used or generated by any of the GNU # gettext tools. Nevertheless it's rather widespead, as it's used by # pygettext[0] and Babel[1]. Emitting unknown-header-field would be # counter-productive. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.13.3/tests/blackbox_tests/zero-bytes-file.mo.tags new/i18nspector-0.13.4/tests/blackbox_tests/zero-bytes-file.mo.tags --- old/i18nspector-0.13.3/tests/blackbox_tests/zero-bytes-file.mo.tags 1970-01-01 01:00:00.000000000 +0100 +++ new/i18nspector-0.13.4/tests/blackbox_tests/zero-bytes-file.mo.tags 2014-03-20 13:55:22.000000000 +0100 @@ -0,0 +1 @@ +E: invalid-mo-file unexpected magic diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.13.3/tests/blackbox_tests/zero-bytes-file.po.tags new/i18nspector-0.13.4/tests/blackbox_tests/zero-bytes-file.po.tags --- old/i18nspector-0.13.3/tests/blackbox_tests/zero-bytes-file.po.tags 1970-01-01 01:00:00.000000000 +0100 +++ new/i18nspector-0.13.4/tests/blackbox_tests/zero-bytes-file.po.tags 2014-03-20 13:55:22.000000000 +0100 @@ -0,0 +1,11 @@ +P: no-language-header-field +I: unable-to-determine-language +P: no-mime-version-header-field MIME-Version: 1.0 +P: no-content-transfer-encoding-header-field Content-Transfer-Encoding: 8bit +E: no-content-type-header-field Content-Type: text/plain; charset=<encoding> +W: no-date-header-field POT-Creation-Date +W: no-date-header-field PO-Revision-Date +W: no-project-id-version-header-field +W: no-report-msgid-bugs-to-header-field +W: no-last-translator-header-field +P: no-language-team-header-field diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.13.3/tests/coverage.txt new/i18nspector-0.13.4/tests/coverage.txt --- old/i18nspector-0.13.3/tests/coverage.txt 2014-01-20 20:04:40.000000000 +0100 +++ new/i18nspector-0.13.4/tests/coverage.txt 2014-03-20 13:55:22.000000000 +0100 @@ -5,7 +5,8 @@ lib 0 0 100% lib.checker 695 649 7% 75-79, 82-94, 98, 104-185, 189-320, 324-448, 453-524, 528-566, 571-603, 608-645, 648-723, 726-875, 880, 886, 893-899 lib.cli 103 77 25% 43-47, 55-64, 67-68, 71-73, 79-111, 114-122, 125-152 -lib.encodings 126 33 74% 49-67, 79-87, 200-212, 216 +lib.domains 10 0 100% +lib.encodings 130 39 70% 49-67, 79-87, 192-193, 200-212, 216-220 lib.gettext 140 0 100% lib.iconv 161 56 65% 41-42, 55-57, 64, 66, 68, 70, 77-78, 87-88, 101-102, 115-127, 134-135, 138-149, 155, 157, 159, 161, 170-171, 184-185, 202-217, 226-227, 230-241 lib.intexpr 256 0 100% @@ -13,9 +14,8 @@ lib.misc 57 0 100% lib.moparser 135 115 15% 47-71, 74, 77-82, 88-115, 118-182, 187-193, 196 lib.paths 7 2 71% 36-37 -lib.polib4us 72 44 39% 39-40, 54, 69, 72-89, 93, 103-105, 126-138, 142, 154, 163-168 -lib.rfc2606 9 4 56% 39-40, 43-44 +lib.polib4us 76 48 37% 39-40, 54, 70, 73-94, 98, 108-110, 131-143, 147, 159, 168-173 lib.tags 136 45 67% 45-49, 52-56, 59, 62, 107, 109, 112, 119-121, 131-132, 141-143, 148-150, 161, 172-179, 185-189, 199-212, 231, 234, 237 lib.terminal 48 19 60% 75-94 --------------------------------------------- -TOTAL 2188 1047 52% +TOTAL 2197 1053 52% diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.13.3/tests/test_domains.py new/i18nspector-0.13.4/tests/test_domains.py --- old/i18nspector-0.13.3/tests/test_domains.py 1970-01-01 01:00:00.000000000 +0100 +++ new/i18nspector-0.13.4/tests/test_domains.py 2014-03-20 13:55:22.000000000 +0100 @@ -0,0 +1,84 @@ +# Copyright © 2014 Jakub Wilk <jw...@jwilk.net> +# +# 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 nose.tools import ( + assert_false, + assert_raises, + assert_true, +) + +import lib.domains as M + +class test_domains: + + def t(self, domain, special=True): + result = M.is_special_domain(domain) + if special: + assert_true(result) + else: + assert_false(result) + + def test_ok(self): + self.t('test.jwilk.net', False) + + def test_in_addr_apra(self): + self.t('119.216.184.93.in-addr.arpa') + + def test_ip6_arpa(self): + self.t('7.a.a.0.7.9.0.1.7.4.4.1.f.b.6.2.d.6.0.0.0.2.2.0.0.0.8.2.6.0.6.2.ip6.arpa') + + def test_test(self): + self.t('test') + self.t('eggs.test') + + def test_localhost(self): + self.t('localhost') + self.t('eggs.localhost') + + def test_invalid(self): + self.t('invalid') + self.t('eggs.invalid') + + def test_example(self): + self.t('example') + for tld in 'com', 'net', 'org': + self.t('example.{tld}'.format(tld=tld)) + self.t('eggs.example.{tld}'.format(tld=tld)) + +class test_emails: + + def t(self, email, special=True): + result = M.is_email_in_special_domain(email) + if special: + assert_true(result) + else: + assert_false(result) + + def test_valid(self): + self.t('jw...@test.jwilk.net', False) + + def test_special(self): + self.t('jw...@example.net') + + def test_no_at(self): + with assert_raises(ValueError): + self.t('jwilk%jwilk.net') + +# vim:ts=4 sw=4 et diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/i18nspector-0.13.3/tests/test_encodings.py new/i18nspector-0.13.4/tests/test_encodings.py --- old/i18nspector-0.13.3/tests/test_encodings.py 2014-01-20 20:04:40.000000000 +0100 +++ new/i18nspector-0.13.4/tests/test_encodings.py 2014-03-20 13:55:22.000000000 +0100 @@ -177,6 +177,13 @@ dec() @aux.fork_isolation + def test_8859(self): + E.install_extra_encodings() + encoding = '8859-2' + portable_encoding = E.propose_portable_encoding(encoding) + assert_equal('ISO-' + encoding, portable_encoding) + + @aux.fork_isolation def test_not_allowed(self): encoding = 'TSCII' def enc(): ++++++ i18nspector.keyring ++++++ --- /var/tmp/diff_new_pack.jQW9pt/_old 2014-03-23 22:34:09.000000000 +0100 +++ /var/tmp/diff_new_pack.jQW9pt/_new 2014-03-23 22:34:09.000000000 +0100 @@ -1,4 +1,4 @@ -pub 4096R/015475F5 2009-10-23 [expires: 2014-01-01] +pub 4096R/015475F5 2009-10-23 [expires: 2015-01-01] uid Jakub Wilk <jw...@jwilk.net> uid Jakub Wilk <jw...@debian.org> uid Jakub Wilk <uba...@users.sf.net> @@ -18,31 +18,31 @@ 9YuCxYtGungL36J0JVhaxiMwLaNXy6Q7IVdS4i38Ky0TBiT4oerhzExc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eABlzsiXoa1xF1O38f06evug6LwlFMJUYXQ4I +7WTsZL0KCeGnA8ca6HYoV7QgSmFrdWIgV2lsayA8dWJhbnVzQHVzZXJzLnNmLm5l dD6JAj0EEwEIACcCGwMFCwkIBwMFFQoJCAsFFgMCAQACHgECF4AFAk3uTjgFCQXU HDgACgkQLU6zpgFUdfWAxg/+PqysL3WIDROwiInHhW3zkaPRhpjOMfHzjptu3K+2 GIL6yXQJtekld6DaFXh6PWIQ/Huw6qvzg/wof9NB/zXeaE/aeP9b9BVq4zz3DPeK @@ -78,5 +78,5 @@ doynJ60razRgyqz9/UJ77+2wn50YVJutP44WiP5NF9ELufGkDo9/r/DfknlIS5py c55t4YjFjD6M2V8oO8pHuQ2TO14TkX629hChBlVCQQBUSU07toQ3iDw5umCFH7To bN5AxyPui0i3KQXs09FW/+n9DTw= -=AA/F +=1quD -----END PGP PUBLIC KEY BLOCK----- -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org