New upstream version 0.25.8
Stuart Prescott
5 years ago
859 | 859 | |
860 | 860 | [mt] |
861 | 861 | names = Maltese |
862 | characters = | |
863 | Ċ Ġ ħ Ħ Ż | |
864 | ċ ġ ħ ħ ż | |
862 | 865 | principal-territory = MT |
863 | 866 | |
864 | 867 | [mus] |
0 | Copyright © 2012-2018 Jakub Wilk <jwilk@jwilk.net> | |
0 | Copyright © 2012-2019 Jakub Wilk <jwilk@jwilk.net> | |
1 | 1 | |
2 | 2 | Permission is hereby granted, free of charge, to any person obtaining a copy |
3 | 3 | of this software and associated documentation files (the “Software”), to deal |
0 | i18nspector (0.25.8) unstable; urgency=low | |
1 | ||
2 | * Fix compatibility with Python 3.8. | |
3 | * Add writing system information for Maltese. | |
4 | * Rephrase help messages for --help, --version. | |
5 | * Improve error handling. | |
6 | * Improve the test suite. | |
7 | ||
8 | -- Jakub Wilk <jwilk@jwilk.net> Thu, 21 Feb 2019 22:23:17 +0100 | |
9 | ||
0 | 10 | i18nspector (0.25.7) unstable; urgency=low |
1 | 11 | |
2 | 12 | * Drop support for Python < 3.3.3. |
0 | 0 | .\" Man page generated from reStructuredText. |
1 | 1 | . |
2 | .TH I18NSPECTOR 1 "2018-12-20" "i18nspector 0.25.7" "" | |
2 | .TH I18NSPECTOR 1 "2019-02-21" "i18nspector 0.25.8" "" | |
3 | 3 | .SH NAME |
4 | 4 | i18nspector \- checking tool for gettext POT, PO and MO files |
5 | 5 | . |
56 | 56 | The default is to use only a single process. |
57 | 57 | .TP |
58 | 58 | .B \-h\fP,\fB \-\-help |
59 | Show the help message and exit. | |
59 | Show help message and exit. | |
60 | 60 | .TP |
61 | 61 | .B \-\-version |
62 | Show the program's version information and exit. | |
62 | Show version information and exit. | |
63 | 63 | .UNINDENT |
64 | 64 | .SH OUTPUT FORMAT |
65 | 65 | .sp |
6 | 6 | ---------------------------------------------- |
7 | 7 | |
8 | 8 | :manual section: 1 |
9 | :version: i18nspector 0.25.7 | |
9 | :version: i18nspector 0.25.8 | |
10 | 10 | :date: |date| |
11 | 11 | |
12 | 12 | Synopsis |
34 | 34 | or ``auto`` to determine the number automatically. |
35 | 35 | The default is to use only a single process. |
36 | 36 | -h, --help |
37 | Show the help message and exit. | |
37 | Show help message and exit. | |
38 | 38 | --version |
39 | Show the program's version information and exit. | |
39 | Show version information and exit. | |
40 | 40 | |
41 | 41 | Output format |
42 | 42 | ------------- |
114 | 114 | # prevent such disaster, fail early if the file doesn't exit. |
115 | 115 | try: |
116 | 116 | os.stat(self.path) |
117 | except EnvironmentError as exc: | |
117 | except OSError as exc: | |
118 | 118 | self.tag('os-error', tags.safestr(exc.strerror)) |
119 | 119 | return |
120 | 120 | if self.options.file_type is None: |
0 | # Copyright © 2012-2018 Jakub Wilk <jwilk@jwilk.net> | |
0 | # Copyright © 2012-2019 Jakub Wilk <jwilk@jwilk.net> | |
1 | 1 | # |
2 | 2 | # Permission is hereby granted, free of charge, to any person obtaining a copy |
3 | 3 | # of this software and associated documentation files (the “Software”), to deal |
38 | 38 | from lib import tags |
39 | 39 | from lib import terminal |
40 | 40 | |
41 | __version__ = '0.25.7' | |
41 | __version__ = '0.25.8' | |
42 | 42 | |
43 | 43 | def initialize_terminal(): |
44 | 44 | if sys.stdout.isatty(): |
92 | 92 | real_root = os.path.join(tmpdir, '') |
93 | 93 | else: |
94 | 94 | real_root = os.path.join(tmpdir, 's', '') |
95 | with open(os.devnull) as bitbucket: | |
96 | ipc.check_call( | |
97 | ['dpkg-source', '--no-copy', '--no-check', '-x', filename, real_root], | |
98 | stdout=bitbucket # dpkg-source would be noisy without this... | |
99 | ) | |
95 | ipc.check_call( | |
96 | ['dpkg-source', '--no-copy', '--no-check', '-x', filename, real_root], | |
97 | stdout=ipc.DEVNULL # dpkg-source would be noisy without this... | |
98 | ) | |
100 | 99 | options = copy_options(options, |
101 | 100 | ignore_tags=ignore_tags, |
102 | 101 | fake_root=(real_root, os.path.join(filename, '')) |
160 | 159 | option_strings=option_strings, |
161 | 160 | dest=dest, |
162 | 161 | nargs=0, |
163 | help="show program's version information and exit" | |
162 | help='show version information and exit' | |
164 | 163 | ) |
165 | 164 | |
166 | 165 | @staticmethod |
168 | 168 | def _visit(self, node, *args): |
169 | 169 | try: |
170 | 170 | fn = getattr(self, '_visit_' + type(node).__name__.lower()) |
171 | except KeyError: # no coverage | |
171 | except AttributeError: # no coverage | |
172 | 172 | raise NotImplementedError(type(node).__name__) |
173 | 173 | return fn(node, *args) |
174 | 174 | |
312 | 312 | |
313 | 313 | def _visit_num(self, node): |
314 | 314 | return self._check_overflow(node.n) |
315 | ||
316 | _visit_constant = _visit_num | |
315 | 317 | |
316 | 318 | def _visit_name(self, node): |
317 | 319 | return self._check_overflow(self._ctxt.n) |
508 | 510 | if (n < 0) or (n >= self._ctxt.max): |
509 | 511 | return |
510 | 512 | return (n, n) |
513 | ||
514 | _visit_constant = _visit_num | |
511 | 515 | |
512 | 516 | def _visit_name(self, node): |
513 | 517 | return (0, self._ctxt.max - 1) |
666 | 670 | return |
667 | 671 | return (0, 1) |
668 | 672 | |
673 | _visit_constant = _visit_num | |
674 | ||
669 | 675 | def _visit_name(self, node): # pylint: disable=unused-argument |
670 | 676 | pass |
671 | 677 |
2 | 2 | Name Stmts Miss Branch BrPart Cover Missing |
3 | 3 | ----------------------------------------------------------------------------- |
4 | 4 | lib/__init__.py 1 0 0 0 100% |
5 | lib/check/__init__.py 802 750 503 0 4% 82-86, 89-102, 110, 116-201, 204-220, 224-356, 360-504, 508-580, 584-627, 632-667, 672-716, 719-797, 800-880, 883-997, 1000-1007, 1010-1026, 1031 | |
6 | lib/check/msgformat/__init__.py 82 69 36 0 11% 31, 35, 38, 41-151 | |
5 | lib/check/__init__.py 801 749 503 0 4% 82-86, 89-102, 116-201, 204-220, 224-356, 360-504, 508-580, 584-627, 632-667, 672-716, 719-797, 800-880, 883-997, 1000-1007, 1010-1026, 1031 | |
6 | lib/check/msgformat/__init__.py 81 68 36 0 11% 31, 38, 41-151 | |
7 | 7 | lib/check/msgformat/c.py 67 56 36 0 11% 37-44, 47-105, 108-129 |
8 | 8 | lib/check/msgformat/pybrace.py 35 26 13 0 19% 37-48, 51-75 |
9 | 9 | lib/check/msgformat/python.py 77 67 47 0 8% 37-109, 112-149 |
10 | 10 | lib/check/msgrepr.py 11 7 2 0 31% 28-34 |
11 | lib/cli.py 158 123 44 0 17% 45-49, 58-67, 70-71, 74-76, 82-112, 115-120, 126-132, 135-143, 146-154, 160, 169-184, 187-193, 196-230 | |
11 | lib/cli.py 157 122 44 0 17% 45-49, 58-67, 70-71, 74-76, 82-111, 114-119, 125-131, 134-142, 145-153, 159, 168-183, 186-192, 195-229 | |
12 | 12 | lib/domains.py 15 0 0 0 100% |
13 | lib/encodings.py 127 36 34 1 73% 50-68, 80-88, 187, 201-213, 217-221, 185->187 | |
13 | lib/encodings.py 124 34 32 1 75% 49-65, 77-85, 184, 198-210, 214-218, 182->184 | |
14 | 14 | lib/gettext.py 105 0 36 0 100% |
15 | lib/iconv.py 158 54 52 17 60% 41-42, 55-57, 64, 66, 68, 70, 83-84, 97-98, 111-123, 130-131, 134-145, 151, 153, 155, 157, 166-167, 180-181, 198-213, 222-223, 226-237, 63->64, 65->66, 67->68, 69->70, 82->83, 96->97, 105->110, 110->111, 129->130, 150->151, 152->153, 154->155, 156->157, 165->166, 179->180, 195->198, 221->222 | |
16 | lib/intexpr.py 407 0 126 0 100% | |
15 | lib/iconv.py 158 49 52 18 63% 41-42, 55-57, 64, 66, 68, 70, 83-84, 97-98, 111-123, 130-131, 134-145, 151, 153, 155, 157, 166-167, 180-181, 203-204, 213, 222-223, 226-237, 63->64, 65->66, 67->68, 69->70, 82->83, 96->97, 105->110, 110->111, 129->130, 150->151, 152->153, 154->155, 156->157, 165->166, 179->180, 198->213, 200->203, 221->222 | |
16 | lib/intexpr.py 409 0 126 0 100% | |
17 | 17 | lib/ling.py 243 2 98 3 99% 181, 281, 159->162, 179->181, 277->283 |
18 | 18 | lib/misc.py 41 0 16 0 100% |
19 | lib/moparser.py 138 92 56 3 28% 68, 76, 91-109, 112-180, 185-194, 197, 56->58, 74->76, 196->197 | |
19 | lib/moparser.py 138 92 56 3 28% 68, 76, 91-109, 112-178, 183-192, 195, 56->58, 74->76, 194->195 | |
20 | 20 | lib/paths.py 7 2 0 0 71% 36-37 |
21 | lib/polib4us.py 111 76 26 0 26% 41-42, 56, 72, 75-96, 100, 110-113, 134-146, 150, 162, 171-176, 187-195, 206, 209, 213-217, 229-236, 244-253 | |
21 | lib/polib4us.py 110 75 26 0 26% 41-42, 56, 72, 75-96, 100, 110-112, 133-145, 149, 161, 170-175, 186-194, 205, 208, 212-216, 228-235, 243-252 | |
22 | 22 | lib/strformat/__init__.py 0 0 0 0 100% |
23 | 23 | lib/strformat/c.py 285 0 168 0 100% |
24 | 24 | lib/strformat/pybrace.py 156 0 74 0 100% |
25 | 25 | lib/strformat/python.py 206 0 94 0 100% |
26 | lib/tags.py 132 37 40 6 70% 47-51, 55, 58, 66, 111, 113, 116, 135-136, 147-149, 154-156, 169, 180-187, 193-197, 207-220, 239, 245, 54->55, 56->58, 110->111, 112->113, 115->116, 168->169 | |
27 | lib/terminal.py 55 24 4 0 53% 79-106 | |
26 | lib/tags.py 131 37 40 6 70% 47-51, 55, 58, 66, 111, 113, 116, 135-136, 147-149, 154-156, 169, 180-187, 193-197, 207-220, 239, 245, 54->55, 56->58, 110->111, 112->113, 115->116, 168->169 | |
27 | lib/terminal.py 46 17 6 1 58% 37-38, 64, 80-93, 63->64 | |
28 | 28 | lib/xml.py 21 0 2 0 100% |
29 | 29 | ----------------------------------------------------------------------------- |
30 | TOTAL 3440 1421 1507 30 55% | |
30 | TOTAL 3425 1403 1507 32 55% |
0 | # Copyright © 2013 Jakub Wilk <jwilk@jwilk.net> | |
0 | # Copyright © 2013-2019 Jakub Wilk <jwilk@jwilk.net> | |
1 | 1 | # |
2 | 2 | # Permission is hereby granted, free of charge, to any person obtaining a copy |
3 | 3 | # of this software and associated documentation files (the “Software”), to deal |
19 | 19 | |
20 | 20 | from nose.tools import ( |
21 | 21 | assert_equal, |
22 | assert_raises, | |
22 | 23 | ) |
23 | 24 | |
24 | 25 | import lib.iconv as M |
46 | 47 | b = b'Do b\xB9ch kim r\xCAt qu\xFD, s\xCF \xAE\xD3 l\xBEp v\xAB x\xAD\xACng' |
47 | 48 | e = 'TCVN-5712' |
48 | 49 | |
50 | def test_incomplete_char(): | |
51 | b = u'Ę'.encode('UTF-8')[:1] | |
52 | with assert_raises(UnicodeDecodeError): | |
53 | M.decode(b, 'UTF-8') | |
54 | ||
49 | 55 | # vim:ts=4 sts=4 sw=4 et |
0 | # Copyright © 2012-2016 Jakub Wilk <jwilk@jwilk.net> | |
0 | # Copyright © 2012-2019 Jakub Wilk <jwilk@jwilk.net> | |
1 | 1 | # |
2 | 2 | # Permission is hereby granted, free of charge, to any person obtaining a copy |
3 | 3 | # of this software and associated documentation files (the “Software”), to deal |
35 | 35 | prefix='i18nspector.tests.', |
36 | 36 | ) |
37 | 37 | |
38 | class IsolatedError(Exception): | |
38 | class IsolatedException(Exception): | |
39 | 39 | pass |
40 | 40 | |
41 | 41 | def _n_relevant_tb_levels(tb): |
85 | 85 | msg = msg.decode('UTF-8').rstrip('\n') |
86 | 86 | pid, status = os.waitpid(pid, 0) |
87 | 87 | if status == (EXIT_EXCEPTION << 8): |
88 | raise IsolatedError('\n\n' + msg) | |
88 | raise IsolatedException() from Exception('\n\n' + msg) | |
89 | 89 | elif status == (EXIT_SKIP_TEST << 8): |
90 | 90 | raise nose.SkipTest(msg) |
91 | 91 | elif status == 0 and msg == '': |