1 |
* Python implies such things. Let's drop 'em and be consistent. |
2 |
|
3 |
Signed-off-by: Aaron Bauman <bman@g.o> |
4 |
--- |
5 |
"\\" | 20 ++++++++++++++++++++ |
6 |
lib/_emerge/EbuildPhase.py | 6 +++--- |
7 |
lib/_emerge/resolver/output.py | 5 ----- |
8 |
lib/portage/elog/mod_custom.py | 1 - |
9 |
lib/portage/elog/mod_echo.py | 4 ++-- |
10 |
lib/portage/elog/mod_mail.py | 2 -- |
11 |
lib/portage/glsa.py | 3 --- |
12 |
lib/portage/mail.py | 1 - |
13 |
lib/portage/sync/controller.py | 3 +-- |
14 |
lib/portage/util/whirlpool.py | 2 -- |
15 |
pylintrc | 1 + |
16 |
11 files changed, 27 insertions(+), 21 deletions(-) |
17 |
create mode 100644 "\\" |
18 |
|
19 |
diff --git "a/\\" "b/\\" |
20 |
new file mode 100644 |
21 |
index 000000000..aaf1d3b1b |
22 |
--- /dev/null |
23 |
+++ "b/\\" |
24 |
@@ -0,0 +1,20 @@ |
25 |
+# elog/mod_custom.py - elog dispatch module |
26 |
+# Copyright 2006-2020 Gentoo Authors |
27 |
+# Distributed under the terms of the GNU General Public License v2 |
28 |
+ |
29 |
+import portage.elog.mod_save |
30 |
+import portage.exception |
31 |
+import portage.process |
32 |
+ |
33 |
+def process(mysettings, key, logentries, fulltext): |
34 |
+ elogfilename = portage.elog.mod_save.process(mysettings, key, logentries, fulltext) |
35 |
+ |
36 |
+ if not mysettings.get("PORTAGE_ELOG_COMMAND"): |
37 |
+ raise portage.exception.MissingParameter("!!! Custom logging requested but PORTAGE_ELOG_COMMAND is not defined") |
38 |
+ else: |
39 |
+ mylogcmd = mysettings["PORTAGE_ELOG_COMMAND"] |
40 |
+ mylogcmd = mylogcmd.replace("${LOGFILE}", elogfilename) |
41 |
+ mylogcmd = mylogcmd.replace("${PACKAGE}", key) |
42 |
+ retval = portage.process.spawn_bash(mylogcmd) |
43 |
+ if retval != 0: |
44 |
+ raise portage.exception.PortageException("!!! PORTAGE_ELOG_COMMAND failed with exitcode %d" % retval) |
45 |
diff --git a/lib/_emerge/EbuildPhase.py b/lib/_emerge/EbuildPhase.py |
46 |
index e6256d0aa..ceffeccee 100644 |
47 |
--- a/lib/_emerge/EbuildPhase.py |
48 |
+++ b/lib/_emerge/EbuildPhase.py |
49 |
@@ -9,11 +9,12 @@ import tempfile |
50 |
|
51 |
from _emerge.AsynchronousLock import AsynchronousLock |
52 |
from _emerge.BinpkgEnvExtractor import BinpkgEnvExtractor |
53 |
-from _emerge.MiscFunctionsProcess import MiscFunctionsProcess |
54 |
-from _emerge.EbuildProcess import EbuildProcess |
55 |
from _emerge.CompositeTask import CompositeTask |
56 |
+from _emerge.EbuildProcess import EbuildProcess |
57 |
+from _emerge.MiscFunctionsProcess import MiscFunctionsProcess |
58 |
from _emerge.PackagePhase import PackagePhase |
59 |
from _emerge.TaskSequence import TaskSequence |
60 |
+ |
61 |
from portage.package.ebuild._ipc.QueryCommand import QueryCommand |
62 |
from portage.util._dyn_libs.soname_deps_qa import ( |
63 |
_get_all_provides, |
64 |
@@ -396,7 +397,6 @@ class EbuildPhase(CompositeTask): |
65 |
fd_pipes=self.fd_pipes, phase=phase, scheduler=self.scheduler, |
66 |
settings=self.settings) |
67 |
self._start_task(clean_phase, self._fail_clean_exit) |
68 |
- return |
69 |
|
70 |
def _fail_clean_exit(self, clean_phase): |
71 |
self._final_exit(clean_phase) |
72 |
diff --git a/lib/_emerge/resolver/output.py b/lib/_emerge/resolver/output.py |
73 |
index 1dcb47020..b6c77ecad 100644 |
74 |
--- a/lib/_emerge/resolver/output.py |
75 |
+++ b/lib/_emerge/resolver/output.py |
76 |
@@ -243,7 +243,6 @@ class Display: |
77 |
cur_use_map[key], old_iuse_map[key], |
78 |
old_use_map[key], is_new, feature_flags, |
79 |
reinst_flags_map.get(key)) |
80 |
- return |
81 |
|
82 |
|
83 |
@staticmethod |
84 |
@@ -539,7 +538,6 @@ class Display: |
85 |
if show_repos and repoadd: |
86 |
myprint += " " + teal("[%s]" % repoadd) |
87 |
writemsg_stdout("%s\n" % (myprint,), noiselevel=-1) |
88 |
- return |
89 |
|
90 |
|
91 |
def print_blockers(self): |
92 |
@@ -548,7 +546,6 @@ class Display: |
93 |
""" |
94 |
for pkg in self.blockers: |
95 |
writemsg_stdout("%s\n" % (pkg,), noiselevel=-1) |
96 |
- return |
97 |
|
98 |
|
99 |
def print_verbose(self, show_repos): |
100 |
@@ -562,7 +559,6 @@ class Display: |
101 |
# that RepoDisplay.__unicode__() is called in python2. |
102 |
writemsg_stdout("%s" % (self.conf.repo_display,), |
103 |
noiselevel=-1) |
104 |
- return |
105 |
|
106 |
|
107 |
def print_changelog(self): |
108 |
@@ -687,7 +683,6 @@ class Display: |
109 |
if ebuild_path_cl is not None: |
110 |
self.changelogs.extend(_calc_changelog( |
111 |
ebuild_path_cl, pkg_info.previous_pkg, pkg.cpv)) |
112 |
- return |
113 |
|
114 |
|
115 |
def check_system_world(self, pkg): |
116 |
diff --git a/lib/portage/elog/mod_custom.py b/lib/portage/elog/mod_custom.py |
117 |
index 7cfafeccc..aaf1d3b1b 100644 |
118 |
--- a/lib/portage/elog/mod_custom.py |
119 |
+++ b/lib/portage/elog/mod_custom.py |
120 |
@@ -18,4 +18,3 @@ def process(mysettings, key, logentries, fulltext): |
121 |
retval = portage.process.spawn_bash(mylogcmd) |
122 |
if retval != 0: |
123 |
raise portage.exception.PortageException("!!! PORTAGE_ELOG_COMMAND failed with exitcode %d" % retval) |
124 |
- return |
125 |
diff --git a/lib/portage/elog/mod_echo.py b/lib/portage/elog/mod_echo.py |
126 |
index 80f2b11ac..a026847b7 100644 |
127 |
--- a/lib/portage/elog/mod_echo.py |
128 |
+++ b/lib/portage/elog/mod_echo.py |
129 |
@@ -3,9 +3,10 @@ |
130 |
# Distributed under the terms of the GNU General Public License v2 |
131 |
|
132 |
import sys |
133 |
-from portage.output import EOutput, colorize |
134 |
+ |
135 |
from portage.const import EBUILD_PHASES |
136 |
from portage.localization import _ |
137 |
+from portage.output import EOutput, colorize |
138 |
|
139 |
|
140 |
_items = [] |
141 |
@@ -61,4 +62,3 @@ def _finalize(): |
142 |
for line in msgcontent: |
143 |
fmap[msgtype](line.strip("\n")) |
144 |
_items = [] |
145 |
- return |
146 |
diff --git a/lib/portage/elog/mod_mail.py b/lib/portage/elog/mod_mail.py |
147 |
index 38eaa277f..f737a80ce 100644 |
148 |
--- a/lib/portage/elog/mod_mail.py |
149 |
+++ b/lib/portage/elog/mod_mail.py |
150 |
@@ -41,5 +41,3 @@ def process(mysettings, key, logentries, fulltext): |
151 |
portage.mail.send_mail(mysettings, mymessage) |
152 |
except PortageException as e: |
153 |
writemsg("%s\n" % str(e), noiselevel=-1) |
154 |
- |
155 |
- return |
156 |
diff --git a/lib/portage/glsa.py b/lib/portage/glsa.py |
157 |
index 9260e7e09..1870d9338 100644 |
158 |
--- a/lib/portage/glsa.py |
159 |
+++ b/lib/portage/glsa.py |
160 |
@@ -492,7 +492,6 @@ class Glsa: |
161 |
finally: |
162 |
f.close() |
163 |
|
164 |
- return None |
165 |
|
166 |
def parse(self, myfile): |
167 |
""" |
168 |
@@ -583,7 +582,6 @@ class Glsa: |
169 |
self.packages[name].append(tmp) |
170 |
# TODO: services aren't really used yet |
171 |
self.services = self.affected.getElementsByTagName("service") |
172 |
- return None |
173 |
|
174 |
def dump(self, outstream=sys.stdout, encoding="utf-8"): |
175 |
""" |
176 |
@@ -684,7 +682,6 @@ class Glsa: |
177 |
mode='a+', encoding=_encodings['content'], errors='strict') |
178 |
checkfile.write(_unicode_decode(self.nr + "\n")) |
179 |
checkfile.close() |
180 |
- return None |
181 |
|
182 |
def getMergeList(self, least_change=True): |
183 |
""" |
184 |
diff --git a/lib/portage/mail.py b/lib/portage/mail.py |
185 |
index 6503b4cc9..f4fccd8c2 100644 |
186 |
--- a/lib/portage/mail.py |
187 |
+++ b/lib/portage/mail.py |
188 |
@@ -136,4 +136,3 @@ def send_mail(mysettings, message): |
189 |
raise portage.exception.PortageException(_("!!! An error occurred while trying to send logmail:\n")+str(e)) |
190 |
except socket.error as e: |
191 |
raise portage.exception.PortageException(_("!!! A network error occurred while trying to send logmail:\n%s\nSure you configured PORTAGE_ELOG_MAILURI correctly?") % str(e)) |
192 |
- return |
193 |
diff --git a/lib/portage/sync/controller.py b/lib/portage/sync/controller.py |
194 |
index cb68e2c37..24ebf4ff8 100644 |
195 |
--- a/lib/portage/sync/controller.py |
196 |
+++ b/lib/portage/sync/controller.py |
197 |
@@ -174,7 +174,7 @@ class SyncManager: |
198 |
|
199 |
|
200 |
def do_callback(self, result): |
201 |
- #print("result:", result, "callback()", self.callback) |
202 |
+ # print("result:", result, "callback()", self.callback) |
203 |
exitcode, updatecache_flg = result |
204 |
self.exitcode = exitcode |
205 |
self.updatecache_flg = updatecache_flg |
206 |
@@ -184,7 +184,6 @@ class SyncManager: |
207 |
writemsg_level(msg + "\n") |
208 |
if self.callback: |
209 |
self.callback(exitcode, updatecache_flg) |
210 |
- return |
211 |
|
212 |
|
213 |
def perform_post_sync_hook(self, reponame, dosyncuri='', repolocation=''): |
214 |
diff --git a/lib/portage/util/whirlpool.py b/lib/portage/util/whirlpool.py |
215 |
index 1071d5155..857abf3ac 100644 |
216 |
--- a/lib/portage/util/whirlpool.py |
217 |
+++ b/lib/portage/util/whirlpool.py |
218 |
@@ -634,7 +634,6 @@ class WhirlpoolStruct: |
219 |
|
220 |
def WhirlpoolInit(ctx): |
221 |
ctx = WhirlpoolStruct() |
222 |
- return |
223 |
|
224 |
def WhirlpoolAdd(source, sourceBits, ctx): |
225 |
if not isinstance(source, bytes): |
226 |
@@ -777,7 +776,6 @@ def processBuffer(ctx): |
227 |
# apply the Miyaguchi-Preneel compression function |
228 |
for i in range(8): |
229 |
ctx.hash[i] ^= state[i] ^ block[i] |
230 |
- return |
231 |
|
232 |
# |
233 |
# Tests. |
234 |
diff --git a/pylintrc b/pylintrc |
235 |
index f2aadf14f..ce5dec11b 100644 |
236 |
--- a/pylintrc |
237 |
+++ b/pylintrc |
238 |
@@ -33,6 +33,7 @@ enable= |
239 |
unused-import, |
240 |
useless-import-alias, |
241 |
useless-object-inheritance, |
242 |
+ useless-return, |
243 |
wildcard-import |
244 |
|
245 |
# A comma-separated list of package or module names from where C extensions may |
246 |
-- |
247 |
2.28.0 |