Kaynağa Gözat

Tweak python string comparisons

Scott Lahteine 4 yıl önce
ebeveyn
işleme
f13fbafe31

+ 6
- 6
buildroot/share/atom/auto_build.py Dosyayı Görüntüle

237
           line_num = path[ line_start + 1 : column_start]
237
           line_num = path[ line_start + 1 : column_start]
238
           if line_num == '':
238
           if line_num == '':
239
             line_num = 1
239
             line_num = 1
240
-        if not(column_start == column_end):
240
+        if column_start != column_end:
241
           column_num = path[ column_start + 1 : column_end]
241
           column_num = path[ column_start + 1 : column_end]
242
           if column_num == '':
242
           if column_num == '':
243
             column_num = 0
243
             column_num = 0
276
 
276
 
277
 
277
 
278
             start = path.find('/')
278
             start = path.find('/')
279
-            if not(0 == start):            # make sure path starts with '/'
279
+            if start != 0:                  # make sure path starts with '/'
280
               while 0 == path.find(' '):    # eat any spaces at the beginning
280
               while 0 == path.find(' '):    # eat any spaces at the beginning
281
                 path = path[ 1 : ]
281
                 path = path[ 1 : ]
282
               path = '/' + path
282
               path = '/' + path
604
           else:
604
           else:
605
               invalid_board()
605
               invalid_board()
606
 
606
 
607
-      if build_type == 'traceback' and not(target_env == 'LPC1768_debug_and_upload' or target_env == 'DUE_debug')  and Marlin_ver == 2:
607
+      if build_type == 'traceback' and target_env != 'LPC1768_debug_and_upload' and target_env != 'DUE_debug' and Marlin_ver == 2:
608
           print("ERROR - this board isn't setup for traceback")
608
           print("ERROR - this board isn't setup for traceback")
609
           print('board_name: ', board_name)
609
           print('board_name: ', board_name)
610
           print('target_env: ', target_env)
610
           print('target_env: ', target_env)
707
           if r_loc > 0 and r_loc < len(text):  # need to split this line
707
           if r_loc > 0 and r_loc < len(text):  # need to split this line
708
             text = text.split('\r')
708
             text = text.split('\r')
709
             for line in text:
709
             for line in text:
710
-              if line != "":
710
+              if line != '':
711
                 write_to_screen_queue(line + '\n')
711
                 write_to_screen_queue(line + '\n')
712
           else:
712
           else:
713
             write_to_screen_queue(text + '\n')
713
             write_to_screen_queue(text + '\n')
1067
             countVar = tk.IntVar()
1067
             countVar = tk.IntVar()
1068
             search_position = '1.0'
1068
             search_position = '1.0'
1069
             search_count = 0
1069
             search_count = 0
1070
-            while not(search_position == '') and search_count < 100:
1070
+            while search_position != '' and search_count < 100:
1071
                 search_position = self.search("error", search_position, stopindex="end", count=countVar, nocase=1)
1071
                 search_position = self.search("error", search_position, stopindex="end", count=countVar, nocase=1)
1072
                 search_count = search_count + 1
1072
                 search_count = search_count + 1
1073
-                if not(search_position == ''):
1073
+                if search_position != '':
1074
                     error_found = True
1074
                     error_found = True
1075
                     end_pos = '{}+{}c'.format(search_position, 5)
1075
                     end_pos = '{}+{}c'.format(search_position, 5)
1076
                     self.tag_add("error_highlight_inactive", search_position, end_pos)
1076
                     self.tag_add("error_highlight_inactive", search_position, end_pos)

+ 1
- 1
buildroot/share/atom/create_custom_upload_command_CDC.py Dosyayı Görüntüle

70
               com_CDC = com_last
70
               com_CDC = com_last
71
               description_CDC = description_last
71
               description_CDC = description_last
72
 
72
 
73
-      if  com_CDC == '' and not(com_first == ''):
73
+      if  com_CDC == '' and com_first != '':
74
           com_CDC = com_first
74
           com_CDC = com_first
75
           description_CDC = description_first
75
           description_CDC = description_first
76
       elif com_CDC == '':
76
       elif com_CDC == '':

Loading…
İptal
Kaydet