eric6/Plugins/CheckerPlugins/SyntaxChecker/pyflakes/translations.py

Sat, 27 Feb 2021 12:08:23 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 27 Feb 2021 12:08:23 +0100
changeset 8138
169e65a6787c
parent 7923
91e843545d9a
permissions
-rw-r--r--

Shell: added functionality to show a prompt when the main client process has exited (e.g. a script ended).

3229
c8bbf88ae439 Fixed a typo in the coding line of translations.py of pyflakes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3208
diff changeset
1 # -*- coding: utf-8 -*-
3205
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7923
91e843545d9a Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7709
diff changeset
3 # Copyright (c) 2014 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
3205
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing message translations for pyflakes warning messages.
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
3484
645c12de6b0c Merge with default branch.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 3229
diff changeset
10
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3544
diff changeset
11 from PyQt5.QtCore import QCoreApplication
3205
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13 __all__ = ["getTranslatedFlakesMessage"]
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15 _messages = {
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16 'F01': QCoreApplication.translate(
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 'pyFlakes',
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 '{0!r} imported but unused.'),
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 'F02': QCoreApplication.translate(
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 'pyFlakes',
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 'Redefinition of unused {0!r} from line {1!r}.'),
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 'F03': QCoreApplication.translate(
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 'pyFlakes',
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 'Import {0!r} from line {1!r} shadowed by loop variable.'),
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 'F04': QCoreApplication.translate(
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 'pyFlakes',
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 "'from {0} import *' used; unable to detect undefined names."),
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 'F05': QCoreApplication.translate(
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 'pyFlakes',
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 'Undefined name {0!r}.'),
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 'F06': QCoreApplication.translate(
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 'pyFlakes',
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 'Undefined name {0!r} in __all__.'),
6742
7cb30f7f94f6 Upgraded pyflakes to 2.1.0
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6645
diff changeset
34 'F07A': QCoreApplication.translate(
3205
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 'pyFlakes',
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 "Local variable {0!r} (defined in enclosing scope on line {1!r})"
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37 " referenced before assignment."),
6742
7cb30f7f94f6 Upgraded pyflakes to 2.1.0
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6645
diff changeset
38 'F07B': QCoreApplication.translate(
7cb30f7f94f6 Upgraded pyflakes to 2.1.0
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6645
diff changeset
39 'pyFlakes',
7cb30f7f94f6 Upgraded pyflakes to 2.1.0
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6645
diff changeset
40 "Local variable {0!r} (defined as a builtin)"
7cb30f7f94f6 Upgraded pyflakes to 2.1.0
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6645
diff changeset
41 " referenced before assignment."),
3205
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42 'F08': QCoreApplication.translate(
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 'pyFlakes',
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 'Duplicate argument {0!r} in function definition.'),
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 'F09': QCoreApplication.translate(
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 'pyFlakes',
3208
884465a61753 Updated pyflakes to version 0.7.3.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3207
diff changeset
47 'Redefinition of {0!r} from line {1!r}.'),
3205
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48 'F10': QCoreApplication.translate(
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 'pyFlakes',
5067
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
50 'from __future__ imports must occur at the beginning of the file'),
3205
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 'F11': QCoreApplication.translate(
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52 'pyFlakes',
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53 'Local variable {0!r} is assigned to but never used.'),
3208
884465a61753 Updated pyflakes to version 0.7.3.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3207
diff changeset
54 'F12': QCoreApplication.translate(
884465a61753 Updated pyflakes to version 0.7.3.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3207
diff changeset
55 'pyFlakes',
884465a61753 Updated pyflakes to version 0.7.3.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3207
diff changeset
56 'List comprehension redefines {0!r} from line {1!r}.'),
884465a61753 Updated pyflakes to version 0.7.3.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3207
diff changeset
57 'F13': QCoreApplication.translate(
884465a61753 Updated pyflakes to version 0.7.3.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3207
diff changeset
58 'pyFlakes',
884465a61753 Updated pyflakes to version 0.7.3.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3207
diff changeset
59 'Syntax error detected in doctest.'),
3544
431c842fd09a updated pyflakes to version 0.8.1 (Python 3.4.0 compatible)
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 3484
diff changeset
60 'F14': QCoreApplication.translate(
431c842fd09a updated pyflakes to version 0.8.1 (Python 3.4.0 compatible)
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 3484
diff changeset
61 'pyFlakes',
431c842fd09a updated pyflakes to version 0.8.1 (Python 3.4.0 compatible)
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 3484
diff changeset
62 "'return' with argument inside generator"),
4502
76f2b46437a6 Updated to pyflakes 1.0.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
63 'F15': QCoreApplication.translate(
76f2b46437a6 Updated to pyflakes 1.0.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
64 'pyFlakes',
76f2b46437a6 Updated to pyflakes 1.0.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
65 "'return' outside function"),
5067
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
66 'F16': QCoreApplication.translate(
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
67 'pyFlakes',
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
68 "'from {0} import *' only allowed at module level"),
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
69 'F17': QCoreApplication.translate(
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
70 'pyFlakes',
5510
cdcd0cd34e79 Upgraded pyflakes to version 1.5.0
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 5389
diff changeset
71 "{0!r} may be undefined, or defined from star imports: {1}"),
5067
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
72 'F18': QCoreApplication.translate(
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
73 'pyFlakes',
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
74 "Dictionary key {0!r} repeated with different values"),
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
75 'F19': QCoreApplication.translate(
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
76 'pyFlakes',
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
77 "Dictionary key variable {0} repeated with different values"),
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
78 'F20': QCoreApplication.translate(
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
79 'pyFlakes',
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
80 "Future feature {0} is not defined"),
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
81 'F21': QCoreApplication.translate(
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
82 'pyFlakes',
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
83 "'yield' outside function"),
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
84 'F22': QCoreApplication.translate(
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
85 'pyFlakes',
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
86 "'continue' not properly in loop"),
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
87 'F23': QCoreApplication.translate(
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
88 'pyFlakes',
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
89 "'break' outside loop"),
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
90 'F24': QCoreApplication.translate(
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
91 'pyFlakes',
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
92 "'continue' not supported inside 'finally' clause"),
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
93 'F25': QCoreApplication.translate(
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
94 'pyFlakes',
5618
b50da40b6bc9 Remove M121 ignore comments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5616
diff changeset
95 "Default 'except:' must be last"),
5067
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
96 'F26': QCoreApplication.translate(
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
97 'pyFlakes',
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
98 "Two starred expressions in assignment"),
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
99 'F27': QCoreApplication.translate(
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
100 'pyFlakes',
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
101 "Too many expressions in star-unpacking assignment"),
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
102 'F28': QCoreApplication.translate(
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
103 'pyFlakes',
e2f171f08af8 Updated pyflakes to 1.2.3+.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
104 "Assertion is always true, perhaps remove parentheses?"),
6353
6a0f3abd6878 upgraded pyflakes to version 2.0.0
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6048
diff changeset
105 'F29': QCoreApplication.translate(
6a0f3abd6878 upgraded pyflakes to version 2.0.0
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6048
diff changeset
106 'pyFlakes',
6a0f3abd6878 upgraded pyflakes to version 2.0.0
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6048
diff changeset
107 "syntax error in forward annotation {0!r}"),
6a0f3abd6878 upgraded pyflakes to version 2.0.0
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6048
diff changeset
108 'F30': QCoreApplication.translate(
6a0f3abd6878 upgraded pyflakes to version 2.0.0
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6048
diff changeset
109 'pyFlakes',
6a0f3abd6878 upgraded pyflakes to version 2.0.0
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6048
diff changeset
110 "'raise NotImplemented' should be 'raise NotImplementedError'"),
6742
7cb30f7f94f6 Upgraded pyflakes to 2.1.0
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6645
diff changeset
111 'F31': QCoreApplication.translate(
7cb30f7f94f6 Upgraded pyflakes to 2.1.0
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6645
diff changeset
112 'pyFlakes',
7cb30f7f94f6 Upgraded pyflakes to 2.1.0
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6645
diff changeset
113 "syntax error in type comment {0!r}"),
7cb30f7f94f6 Upgraded pyflakes to 2.1.0
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6645
diff changeset
114 'F32': QCoreApplication.translate(
7cb30f7f94f6 Upgraded pyflakes to 2.1.0
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6645
diff changeset
115 'pyFlakes',
7cb30f7f94f6 Upgraded pyflakes to 2.1.0
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6645
diff changeset
116 "use of >> is invalid with print function"),
7cb30f7f94f6 Upgraded pyflakes to 2.1.0
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6645
diff changeset
117 'F33': QCoreApplication.translate(
7cb30f7f94f6 Upgraded pyflakes to 2.1.0
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6645
diff changeset
118 'pyFlakes',
7cb30f7f94f6 Upgraded pyflakes to 2.1.0
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6645
diff changeset
119 "use ==/!= to compare str, bytes, and int literals"),
7395
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
120 'F34': QCoreApplication.translate(
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
121 'pyFlakes',
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
122 "f-string is missing placeholders"),
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
123 'F35': QCoreApplication.translate(
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
124 'pyFlakes',
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
125 "'...'.format(...) has unused arguments at position(s): {0}"),
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
126 'F36': QCoreApplication.translate(
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
127 'pyFlakes',
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
128 "'...'.format(...) has unused named argument(s): {0}"),
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
129 'F37': QCoreApplication.translate(
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
130 'pyFlakes',
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
131 "'...'.format(...) is missing argument(s) for placeholder(s): {0}"),
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
132 'F38': QCoreApplication.translate(
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
133 'pyFlakes',
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
134 "'...'.format(...) mixes automatic and manual numbering"),
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
135 'F39': QCoreApplication.translate(
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
136 'pyFlakes',
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
137 "'...'.format(...) has invalid format string: {0}"),
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
138 'F40': QCoreApplication.translate(
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
139 'pyFlakes',
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
140 "'...' % ... has invalid format string: {0}"),
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
141 'F41': QCoreApplication.translate(
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
142 'pyFlakes',
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
143 "'...' % ... has mixed positional and named placeholders"),
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
144 'F42': QCoreApplication.translate(
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
145 'pyFlakes',
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
146 "'...' % ... has unsupported format character {0!r}"),
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
147 'F43': QCoreApplication.translate(
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
148 'pyFlakes',
7709
7c3968742fd2 PyFlakes interface: fixed a wrong format specification in the error messages contained in translate.py.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7635
diff changeset
149 "'...' % ... has {0:d} placeholder(s) but {1:d} substitution(s)"),
7395
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
150 'F44': QCoreApplication.translate(
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
151 'pyFlakes',
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
152 "'...' % ... has unused named argument(s): {0}"),
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
153 'F45': QCoreApplication.translate(
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
154 'pyFlakes',
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
155 "'...' % ... is missing argument(s) for placeholder(s): {0}"),
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
156 'F46': QCoreApplication.translate(
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
157 'pyFlakes',
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
158 "'...' % ... expected mapping but got sequence"),
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
159 'F47': QCoreApplication.translate(
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
160 'pyFlakes',
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
161 "'...' % ... expected sequence but got mapping"),
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
162 'F48': QCoreApplication.translate(
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
163 'pyFlakes',
dd50d0f4c588 pyflakes: updated to repository as of 2020-02-03.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
164 "'...' % ... `*` specifier requires sequence"),
7617
a0e162a50ad7 Syntax Checker: updated pyflakes to version 2.2.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7395
diff changeset
165 'F49': QCoreApplication.translate(
a0e162a50ad7 Syntax Checker: updated pyflakes to version 2.2.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7395
diff changeset
166 'pyFlakes',
a0e162a50ad7 Syntax Checker: updated pyflakes to version 2.2.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7395
diff changeset
167 "'if tuple literal' is always true, perhaps remove accidental comma?"
a0e162a50ad7 Syntax Checker: updated pyflakes to version 2.2.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7395
diff changeset
168 ),
3205
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
169 }
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
170
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
171
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
172 def getTranslatedFlakesMessage(message_id, message_args):
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
173 """
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
174 Module function to get a translated and formatted message for a
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
175 given pyflakes message ID.
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
176
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
177 @param message_id message ID (string)
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
178 @param message_args arguments for a formatted message (list)
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
179 @return translated and formatted message (string)
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
180 """
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
181 if message_id in _messages:
3484
645c12de6b0c Merge with default branch.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 3229
diff changeset
182 msg = _messages[message_id].replace("{0!r}", "'{0}'")
645c12de6b0c Merge with default branch.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 3229
diff changeset
183 msg = msg.replace("{1!r}", "'{1}'")
645c12de6b0c Merge with default branch.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 3229
diff changeset
184 return msg.format(*message_args)
3205
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
185 else:
157dcfafc5d2 Made the pyflakes messages translatable even when sent by the Python2 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
186 return QCoreApplication.translate(
7256
4ef3b78ebb4e Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
187 "pyFlakes", "no message defined for code '{0}'"
4ef3b78ebb4e Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
188 ).format(message_id)

eric ide

mercurial