Codebase list i18nspector / upstream/latest
New upstream version 0.25.8 Stuart Prescott 5 years ago
11 changed file(s) with 56 addition(s) and 32 deletion(s). Raw diff Collapse all Expand all
859859
860860 [mt]
861861 names = Maltese
862 characters =
863 Ċ Ġ ħ Ħ Ż
864 ċ ġ ħ ħ ż
862865 principal-territory = MT
863866
864867 [mus]
0 Copyright © 2012-2018 Jakub Wilk <jwilk@jwilk.net>
0 Copyright © 2012-2019 Jakub Wilk <jwilk@jwilk.net>
11
22 Permission is hereby granted, free of charge, to any person obtaining a copy
33 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
010 i18nspector (0.25.7) unstable; urgency=low
111
212 * Drop support for Python < 3.3.3.
00 .\" Man page generated from reStructuredText.
11 .
2 .TH I18NSPECTOR 1 "2018-12-20" "i18nspector 0.25.7" ""
2 .TH I18NSPECTOR 1 "2019-02-21" "i18nspector 0.25.8" ""
33 .SH NAME
44 i18nspector \- checking tool for gettext POT, PO and MO files
55 .
5656 The default is to use only a single process.
5757 .TP
5858 .B \-h\fP,\fB \-\-help
59 Show the help message and exit.
59 Show help message and exit.
6060 .TP
6161 .B \-\-version
62 Show the program's version information and exit.
62 Show version information and exit.
6363 .UNINDENT
6464 .SH OUTPUT FORMAT
6565 .sp
66 ----------------------------------------------
77
88 :manual section: 1
9 :version: i18nspector 0.25.7
9 :version: i18nspector 0.25.8
1010 :date: |date|
1111
1212 Synopsis
3434 or ``auto`` to determine the number automatically.
3535 The default is to use only a single process.
3636 -h, --help
37 Show the help message and exit.
37 Show help message and exit.
3838 --version
39 Show the program's version information and exit.
39 Show version information and exit.
4040
4141 Output format
4242 -------------
114114 # prevent such disaster, fail early if the file doesn't exit.
115115 try:
116116 os.stat(self.path)
117 except EnvironmentError as exc:
117 except OSError as exc:
118118 self.tag('os-error', tags.safestr(exc.strerror))
119119 return
120120 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>
11 #
22 # Permission is hereby granted, free of charge, to any person obtaining a copy
33 # of this software and associated documentation files (the “Software”), to deal
3838 from lib import tags
3939 from lib import terminal
4040
41 __version__ = '0.25.7'
41 __version__ = '0.25.8'
4242
4343 def initialize_terminal():
4444 if sys.stdout.isatty():
9292 real_root = os.path.join(tmpdir, '')
9393 else:
9494 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 )
10099 options = copy_options(options,
101100 ignore_tags=ignore_tags,
102101 fake_root=(real_root, os.path.join(filename, ''))
160159 option_strings=option_strings,
161160 dest=dest,
162161 nargs=0,
163 help="show program's version information and exit"
162 help='show version information and exit'
164163 )
165164
166165 @staticmethod
168168 def _visit(self, node, *args):
169169 try:
170170 fn = getattr(self, '_visit_' + type(node).__name__.lower())
171 except KeyError: # no coverage
171 except AttributeError: # no coverage
172172 raise NotImplementedError(type(node).__name__)
173173 return fn(node, *args)
174174
312312
313313 def _visit_num(self, node):
314314 return self._check_overflow(node.n)
315
316 _visit_constant = _visit_num
315317
316318 def _visit_name(self, node):
317319 return self._check_overflow(self._ctxt.n)
508510 if (n < 0) or (n >= self._ctxt.max):
509511 return
510512 return (n, n)
513
514 _visit_constant = _visit_num
511515
512516 def _visit_name(self, node):
513517 return (0, self._ctxt.max - 1)
666670 return
667671 return (0, 1)
668672
673 _visit_constant = _visit_num
674
669675 def _visit_name(self, node): # pylint: disable=unused-argument
670676 pass
671677
22 Name Stmts Miss Branch BrPart Cover Missing
33 -----------------------------------------------------------------------------
44 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
77 lib/check/msgformat/c.py 67 56 36 0 11% 37-44, 47-105, 108-129
88 lib/check/msgformat/pybrace.py 35 26 13 0 19% 37-48, 51-75
99 lib/check/msgformat/python.py 77 67 47 0 8% 37-109, 112-149
1010 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
1212 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
1414 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%
1717 lib/ling.py 243 2 98 3 99% 181, 281, 159->162, 179->181, 277->283
1818 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
2020 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
2222 lib/strformat/__init__.py 0 0 0 0 100%
2323 lib/strformat/c.py 285 0 168 0 100%
2424 lib/strformat/pybrace.py 156 0 74 0 100%
2525 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
2828 lib/xml.py 21 0 2 0 100%
2929 -----------------------------------------------------------------------------
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>
11 #
22 # Permission is hereby granted, free of charge, to any person obtaining a copy
33 # of this software and associated documentation files (the “Software”), to deal
1919
2020 from nose.tools import (
2121 assert_equal,
22 assert_raises,
2223 )
2324
2425 import lib.iconv as M
4647 b = b'Do b\xB9ch kim r\xCAt qu\xFD, s\xCF \xAE\xD3 l\xBEp v\xAB x\xAD\xACng'
4748 e = 'TCVN-5712'
4849
50 def test_incomplete_char():
51 b = u'Ę'.encode('UTF-8')[:1]
52 with assert_raises(UnicodeDecodeError):
53 M.decode(b, 'UTF-8')
54
4955 # 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>
11 #
22 # Permission is hereby granted, free of charge, to any person obtaining a copy
33 # of this software and associated documentation files (the “Software”), to deal
3535 prefix='i18nspector.tests.',
3636 )
3737
38 class IsolatedError(Exception):
38 class IsolatedException(Exception):
3939 pass
4040
4141 def _n_relevant_tb_levels(tb):
8585 msg = msg.decode('UTF-8').rstrip('\n')
8686 pid, status = os.waitpid(pid, 0)
8787 if status == (EXIT_EXCEPTION << 8):
88 raise IsolatedError('\n\n' + msg)
88 raise IsolatedException() from Exception('\n\n' + msg)
8989 elif status == (EXIT_SKIP_TEST << 8):
9090 raise nose.SkipTest(msg)
9191 elif status == 0 and msg == '':