From f13fbafe31fca75dfa828d38bbda78a2c001f743 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 7 Aug 2019 00:26:31 -0500 Subject: [PATCH] Tweak python string comparisons --- buildroot/share/atom/auto_build.py | 12 ++++++------ .../share/atom/create_custom_upload_command_CDC.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/buildroot/share/atom/auto_build.py b/buildroot/share/atom/auto_build.py index 6d334308f7..13a7e84aa5 100644 --- a/buildroot/share/atom/auto_build.py +++ b/buildroot/share/atom/auto_build.py @@ -237,7 +237,7 @@ def resolve_path(path): line_num = path[ line_start + 1 : column_start] if line_num == '': line_num = 1 - if not(column_start == column_end): + if column_start != column_end: column_num = path[ column_start + 1 : column_end] if column_num == '': column_num = 0 @@ -276,7 +276,7 @@ def resolve_path(path): start = path.find('/') - if not(0 == start): # make sure path starts with '/' + if start != 0: # make sure path starts with '/' while 0 == path.find(' '): # eat any spaces at the beginning path = path[ 1 : ] path = '/' + path @@ -604,7 +604,7 @@ def get_env(board_name, ver_Marlin): else: invalid_board() - if build_type == 'traceback' and not(target_env == 'LPC1768_debug_and_upload' or target_env == 'DUE_debug') and Marlin_ver == 2: + if build_type == 'traceback' and target_env != 'LPC1768_debug_and_upload' and target_env != 'DUE_debug' and Marlin_ver == 2: print("ERROR - this board isn't setup for traceback") print('board_name: ', board_name) print('target_env: ', target_env) @@ -707,7 +707,7 @@ def line_print(line_input): if r_loc > 0 and r_loc < len(text): # need to split this line text = text.split('\r') for line in text: - if line != "": + if line != '': write_to_screen_queue(line + '\n') else: write_to_screen_queue(text + '\n') @@ -1067,10 +1067,10 @@ class output_window(Text): countVar = tk.IntVar() search_position = '1.0' search_count = 0 - while not(search_position == '') and search_count < 100: + while search_position != '' and search_count < 100: search_position = self.search("error", search_position, stopindex="end", count=countVar, nocase=1) search_count = search_count + 1 - if not(search_position == ''): + if search_position != '': error_found = True end_pos = '{}+{}c'.format(search_position, 5) self.tag_add("error_highlight_inactive", search_position, end_pos) diff --git a/buildroot/share/atom/create_custom_upload_command_CDC.py b/buildroot/share/atom/create_custom_upload_command_CDC.py index 484842f778..c2ed04e60a 100644 --- a/buildroot/share/atom/create_custom_upload_command_CDC.py +++ b/buildroot/share/atom/create_custom_upload_command_CDC.py @@ -70,7 +70,7 @@ else: com_CDC = com_last description_CDC = description_last - if com_CDC == '' and not(com_first == ''): + if com_CDC == '' and com_first != '': com_CDC = com_first description_CDC = description_first elif com_CDC == '':