Tue, 10 Dec 2024 15:46:34 +0100
Updated copyright for 2025.
8166 | 1 | # -*- coding: utf-8 -*- |
2 | ||
11090
f5f5f5803935
Updated copyright for 2025.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10439
diff
changeset
|
3 | # Copyright (c) 2020 - 2025 Detlev Offenbach <detlev@die-offenbachs.de> |
8166 | 4 | # |
5 | ||
6 | ||
7 | """ | |
8 | Module implementing message translations for the code style plugin messages | |
8187
7bfee4d12551
Corrected some module descriptions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8166
diff
changeset
|
9 | (pathlib part). |
8166 | 10 | """ |
11 | ||
8318
962bce857696
Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8312
diff
changeset
|
12 | from PyQt6.QtCore import QCoreApplication |
8166 | 13 | |
14 | _pathlibMessages = { | |
15 | "P101": QCoreApplication.translate( | |
16 | "PathlibChecker", | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
17 | "os.chmod('foo', 0o444) should be replaced by foo_path.chmod(0o444)", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
18 | ), |
8166 | 19 | "P102": QCoreApplication.translate( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
20 | "PathlibChecker", "os.mkdir('foo') should be replaced by foo_path.mkdir()" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
21 | ), |
8166 | 22 | "P103": QCoreApplication.translate( |
23 | "PathlibChecker", | |
9576
be9f8e7e42e0
Corrected some 'wrong' string quotes caused by the Black line merging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
24 | "os.makedirs('foo/bar') should be replaced by bar_path.mkdir(parents=True)", |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
25 | ), |
8166 | 26 | "P104": QCoreApplication.translate( |
27 | "PathlibChecker", | |
9576
be9f8e7e42e0
Corrected some 'wrong' string quotes caused by the Black line merging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
28 | "os.rename('foo', 'bar') should be replaced by foo_path.rename(Path('bar'))", |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
29 | ), |
8166 | 30 | "P105": QCoreApplication.translate( |
31 | "PathlibChecker", | |
32 | "os.replace('foo', 'bar') should be replaced by " | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
33 | "foo_path.replace(Path('bar'))", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
34 | ), |
8166 | 35 | "P106": QCoreApplication.translate( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
36 | "PathlibChecker", "os.rmdir('foo') should be replaced by foo_path.rmdir()" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
37 | ), |
8166 | 38 | "P107": QCoreApplication.translate( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
39 | "PathlibChecker", "os.remove('foo') should be replaced by foo_path.unlink()" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
40 | ), |
8166 | 41 | "P108": QCoreApplication.translate( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
42 | "PathlibChecker", "os.unlink('foo'') should be replaced by foo_path.unlink()" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
43 | ), |
8166 | 44 | "P109": QCoreApplication.translate( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
45 | "PathlibChecker", "os.getcwd() should be replaced by Path.cwd()" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
46 | ), |
8166 | 47 | "P110": QCoreApplication.translate( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
48 | "PathlibChecker", "os.readlink('foo') should be replaced by foo_path.readlink()" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
49 | ), |
8166 | 50 | "P111": QCoreApplication.translate( |
51 | "PathlibChecker", | |
52 | "os.stat('foo') should be replaced by foo_path.stat() or " | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
53 | "foo_path.owner() or foo_path.group()", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
54 | ), |
8764
18c69de2292f
Upgraded the pathlib checker to support additional replacements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
55 | "P112": QCoreApplication.translate( |
18c69de2292f
Upgraded the pathlib checker to support additional replacements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
56 | "PathlibChecker", |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
57 | "os.listdir(path='foo') should be replaced by foo_path.iterdir()", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
58 | ), |
8764
18c69de2292f
Upgraded the pathlib checker to support additional replacements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
59 | "P113": QCoreApplication.translate( |
18c69de2292f
Upgraded the pathlib checker to support additional replacements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
60 | "PathlibChecker", |
9576
be9f8e7e42e0
Corrected some 'wrong' string quotes caused by the Black line merging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
61 | "os.link('bar', 'foo') should be replaced by foo_path.hardlink_to('bar')", |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
62 | ), |
8764
18c69de2292f
Upgraded the pathlib checker to support additional replacements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
63 | "P114": QCoreApplication.translate( |
18c69de2292f
Upgraded the pathlib checker to support additional replacements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
64 | "PathlibChecker", |
9576
be9f8e7e42e0
Corrected some 'wrong' string quotes caused by the Black line merging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
65 | "os.symlink('bar', 'foo') should be replaced by foo_path.symlink_to('bar')", |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
66 | ), |
8166 | 67 | "P201": QCoreApplication.translate( |
68 | "PathlibChecker", | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
69 | "os.path.abspath('foo') should be replaced by foo_path.resolve()", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
70 | ), |
8166 | 71 | "P202": QCoreApplication.translate( |
72 | "PathlibChecker", | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
73 | "os.path.exists('foo') should be replaced by foo_path.exists()", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
74 | ), |
8166 | 75 | "P203": QCoreApplication.translate( |
76 | "PathlibChecker", | |
9576
be9f8e7e42e0
Corrected some 'wrong' string quotes caused by the Black line merging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
77 | "os.path.expanduser('~/foo') should be replaced by foo_path.expanduser()", |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
78 | ), |
8166 | 79 | "P204": QCoreApplication.translate( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
80 | "PathlibChecker", "os.path.isdir('foo') should be replaced by foo_path.is_dir()" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
81 | ), |
8166 | 82 | "P205": QCoreApplication.translate( |
83 | "PathlibChecker", | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
84 | "os.path.isfile('foo') should be replaced by foo_path.is_file()", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
85 | ), |
8166 | 86 | "P206": QCoreApplication.translate( |
87 | "PathlibChecker", | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
88 | "os.path.islink('foo') should be replaced by foo_path.is_symlink()", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
89 | ), |
8166 | 90 | "P207": QCoreApplication.translate( |
91 | "PathlibChecker", | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
92 | "os.path.isabs('foo') should be replaced by foo_path.is_absolute()", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
93 | ), |
8166 | 94 | "P208": QCoreApplication.translate( |
95 | "PathlibChecker", | |
9576
be9f8e7e42e0
Corrected some 'wrong' string quotes caused by the Black line merging.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
96 | "os.path.join('foo', 'bar') should be replaced by foo_path / 'bar'", |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
97 | ), |
8166 | 98 | "P209": QCoreApplication.translate( |
99 | "PathlibChecker", | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
100 | "os.path.basename('foo/bar') should be replaced by bar_path.name", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
101 | ), |
8166 | 102 | "P210": QCoreApplication.translate( |
103 | "PathlibChecker", | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
104 | "os.path.dirname('foo/bar') should be replaced by bar_path.parent", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
105 | ), |
8166 | 106 | "P211": QCoreApplication.translate( |
107 | "PathlibChecker", | |
108 | "os.path.samefile('foo', 'bar') should be replaced by " | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
109 | "foo_path.samefile(bar_path)", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
110 | ), |
8166 | 111 | "P212": QCoreApplication.translate( |
112 | "PathlibChecker", | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
113 | "os.path.splitext('foo.bar') should be replaced by foo_path.suffix", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
114 | ), |
8764
18c69de2292f
Upgraded the pathlib checker to support additional replacements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
115 | "P213": QCoreApplication.translate( |
18c69de2292f
Upgraded the pathlib checker to support additional replacements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
116 | "PathlibChecker", |
18c69de2292f
Upgraded the pathlib checker to support additional replacements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
117 | "os.path.relpath('/bar/foo', start='bar') should be replaced by " |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
118 | "foo_path.relative_to('/bar')", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
119 | ), |
8166 | 120 | "P301": QCoreApplication.translate( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
121 | "PathlibChecker", "open('foo') should be replaced by Path('foo').open()" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
122 | ), |
8166 | 123 | "P401": QCoreApplication.translate( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
124 | "PathlibChecker", "py.path.local is in maintenance mode, use pathlib instead" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
125 | ), |
8166 | 126 | } |