diff options
author | Frazer Clews <frazer.clews@codethink.co.uk> | 2020-01-16 17:11:19 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-01-19 13:31:05 +0000 |
commit | fa5524890e86d353ee7d2194ccdd6c84e9bd2d31 (patch) | |
tree | f3d46ddbd5dd2b772a727b04303bb97b8ae43b9b /bitbake/lib/bb/ui | |
parent | 0ac5174c7d39a3e49893df0d517d47bec1935555 (diff) | |
download | poky-fa5524890e86d353ee7d2194ccdd6c84e9bd2d31.tar.gz |
bitbake: lib: amend code to use proper singleton comparisons where possible
amend the code to handle singleton comparisons properly so it only checks
if they only refer to the same object or not, and not bother
comparing the values.
(Bitbake rev: b809a6812aa15a8a9af97bc382cc4b19571e6bfc)
Signed-off-by: Frazer Clews <frazer.clews@codethink.co.uk>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui')
-rw-r--r-- | bitbake/lib/bb/ui/buildinfohelper.py | 8 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/knotty.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/ncurses.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/taskexp.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/toasterui.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/uievent.py | 2 |
6 files changed, 9 insertions, 9 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py index 5cbca97f3f..82c62e3324 100644 --- a/bitbake/lib/bb/ui/buildinfohelper.py +++ b/bitbake/lib/bb/ui/buildinfohelper.py | |||
@@ -935,7 +935,7 @@ class BuildInfoHelper(object): | |||
935 | 935 | ||
936 | # only reset the build name if the one on the server is actually | 936 | # only reset the build name if the one on the server is actually |
937 | # a valid value for the build_name field | 937 | # a valid value for the build_name field |
938 | if build_name != None: | 938 | if build_name is not None: |
939 | build_info['build_name'] = build_name | 939 | build_info['build_name'] = build_name |
940 | changed = True | 940 | changed = True |
941 | 941 | ||
@@ -1194,7 +1194,7 @@ class BuildInfoHelper(object): | |||
1194 | evdata = BuildInfoHelper._get_data_from_event(event) | 1194 | evdata = BuildInfoHelper._get_data_from_event(event) |
1195 | 1195 | ||
1196 | for t in self.internal_state['targets']: | 1196 | for t in self.internal_state['targets']: |
1197 | if t.is_image == True: | 1197 | if t.is_image: |
1198 | output_files = list(evdata.keys()) | 1198 | output_files = list(evdata.keys()) |
1199 | for output in output_files: | 1199 | for output in output_files: |
1200 | if t.target in output and 'rootfs' in output and not output.endswith(".manifest"): | 1200 | if t.target in output and 'rootfs' in output and not output.endswith(".manifest"): |
@@ -1236,7 +1236,7 @@ class BuildInfoHelper(object): | |||
1236 | task_information['outcome'] = Task.OUTCOME_PREBUILT | 1236 | task_information['outcome'] = Task.OUTCOME_PREBUILT |
1237 | else: | 1237 | else: |
1238 | task_information['task_executed'] = True | 1238 | task_information['task_executed'] = True |
1239 | if 'noexec' in vars(event) and event.noexec == True: | 1239 | if 'noexec' in vars(event) and event.noexec: |
1240 | task_information['task_executed'] = False | 1240 | task_information['task_executed'] = False |
1241 | task_information['outcome'] = Task.OUTCOME_EMPTY | 1241 | task_information['outcome'] = Task.OUTCOME_EMPTY |
1242 | task_information['script_type'] = Task.CODING_NA | 1242 | task_information['script_type'] = Task.CODING_NA |
@@ -1776,7 +1776,7 @@ class BuildInfoHelper(object): | |||
1776 | image_file_extensions_unique = {} | 1776 | image_file_extensions_unique = {} |
1777 | image_fstypes = self.server.runCommand( | 1777 | image_fstypes = self.server.runCommand( |
1778 | ['getVariable', 'IMAGE_FSTYPES'])[0] | 1778 | ['getVariable', 'IMAGE_FSTYPES'])[0] |
1779 | if image_fstypes != None: | 1779 | if image_fstypes is not None: |
1780 | image_types_str = image_fstypes.strip() | 1780 | image_types_str = image_fstypes.strip() |
1781 | image_file_extensions = re.sub(r' {2,}', ' ', image_types_str) | 1781 | image_file_extensions = re.sub(r' {2,}', ' ', image_types_str) |
1782 | image_file_extensions_unique = set(image_file_extensions.split(' ')) | 1782 | image_file_extensions_unique = set(image_file_extensions.split(' ')) |
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py index 19008a4ead..a0340dfc20 100644 --- a/bitbake/lib/bb/ui/knotty.py +++ b/bitbake/lib/bb/ui/knotty.py | |||
@@ -447,7 +447,7 @@ def main(server, eventHandler, params, tf = TerminalFilter): | |||
447 | if error: | 447 | if error: |
448 | logger.error("Command '%s' failed: %s" % (cmdline, error)) | 448 | logger.error("Command '%s' failed: %s" % (cmdline, error)) |
449 | return 1 | 449 | return 1 |
450 | elif ret != True: | 450 | elif not ret: |
451 | logger.error("Command '%s' failed: returned %s" % (cmdline, ret)) | 451 | logger.error("Command '%s' failed: returned %s" % (cmdline, ret)) |
452 | return 1 | 452 | return 1 |
453 | 453 | ||
diff --git a/bitbake/lib/bb/ui/ncurses.py b/bitbake/lib/bb/ui/ncurses.py index 49569e375b..da4fbeabb6 100644 --- a/bitbake/lib/bb/ui/ncurses.py +++ b/bitbake/lib/bb/ui/ncurses.py | |||
@@ -238,7 +238,7 @@ class NCursesUI: | |||
238 | if error: | 238 | if error: |
239 | print("Error running command '%s': %s" % (cmdline, error)) | 239 | print("Error running command '%s': %s" % (cmdline, error)) |
240 | return | 240 | return |
241 | elif ret != True: | 241 | elif not ret: |
242 | print("Couldn't get default commandlind! %s" % ret) | 242 | print("Couldn't get default commandlind! %s" % ret) |
243 | return | 243 | return |
244 | except xmlrpc.client.Fault as x: | 244 | except xmlrpc.client.Fault as x: |
diff --git a/bitbake/lib/bb/ui/taskexp.py b/bitbake/lib/bb/ui/taskexp.py index 7895102b95..8fff244235 100644 --- a/bitbake/lib/bb/ui/taskexp.py +++ b/bitbake/lib/bb/ui/taskexp.py | |||
@@ -200,7 +200,7 @@ def main(server, eventHandler, params): | |||
200 | if error: | 200 | if error: |
201 | print("Error running command '%s': %s" % (cmdline, error)) | 201 | print("Error running command '%s': %s" % (cmdline, error)) |
202 | return 1 | 202 | return 1 |
203 | elif ret != True: | 203 | elif not ret: |
204 | print("Error running command '%s': returned %s" % (cmdline, ret)) | 204 | print("Error running command '%s': returned %s" % (cmdline, ret)) |
205 | return 1 | 205 | return 1 |
206 | except client.Fault as x: | 206 | except client.Fault as x: |
diff --git a/bitbake/lib/bb/ui/toasterui.py b/bitbake/lib/bb/ui/toasterui.py index 51892c9a09..9260f5d9d7 100644 --- a/bitbake/lib/bb/ui/toasterui.py +++ b/bitbake/lib/bb/ui/toasterui.py | |||
@@ -176,7 +176,7 @@ def main(server, eventHandler, params): | |||
176 | if error: | 176 | if error: |
177 | logger.error("Command '%s' failed: %s" % (cmdline, error)) | 177 | logger.error("Command '%s' failed: %s" % (cmdline, error)) |
178 | return 1 | 178 | return 1 |
179 | elif ret != True: | 179 | elif not ret: |
180 | logger.error("Command '%s' failed: returned %s" % (cmdline, ret)) | 180 | logger.error("Command '%s' failed: returned %s" % (cmdline, ret)) |
181 | return 1 | 181 | return 1 |
182 | 182 | ||
diff --git a/bitbake/lib/bb/ui/uievent.py b/bitbake/lib/bb/ui/uievent.py index fedb05064d..13d0d4a04c 100644 --- a/bitbake/lib/bb/ui/uievent.py +++ b/bitbake/lib/bb/ui/uievent.py | |||
@@ -46,7 +46,7 @@ class BBUIEventQueue: | |||
46 | self.EventHandle = ret | 46 | self.EventHandle = ret |
47 | error = "" | 47 | error = "" |
48 | 48 | ||
49 | if self.EventHandle != None: | 49 | if self.EventHandle is not None: |
50 | break | 50 | break |
51 | 51 | ||
52 | errmsg = "Could not register UI event handler. Error: %s, host %s, "\ | 52 | errmsg = "Could not register UI event handler. Error: %s, host %s, "\ |