diff --git a/src/Mod/CAM/Path/Post/scripts/KineticNCBeamicon2_post.py b/src/Mod/CAM/Path/Post/scripts/KineticNCBeamicon2_post.py index 3008d6e032..d3334aeff6 100644 --- a/src/Mod/CAM/Path/Post/scripts/KineticNCBeamicon2_post.py +++ b/src/Mod/CAM/Path/Post/scripts/KineticNCBeamicon2_post.py @@ -344,7 +344,7 @@ def parse(pathobj): if command == lastcommand: outstring.pop(0) - if c.Name[0] == "(" and not OUTPUT_COMMENTS: # command is a comment + if c.Name.startswith("(") and not OUTPUT_COMMENTS: # command is a comment continue # Now add the remaining parameters in order diff --git a/src/Mod/CAM/Path/Post/scripts/centroid_post.py b/src/Mod/CAM/Path/Post/scripts/centroid_post.py index 49c58d1137..8bf2660401 100644 --- a/src/Mod/CAM/Path/Post/scripts/centroid_post.py +++ b/src/Mod/CAM/Path/Post/scripts/centroid_post.py @@ -282,7 +282,7 @@ def parse(pathobj): commandlist = [] # list of elements in the command, code and params. command = c.Name # command M or G code or comment string - if command[0] == "(": + if command.startswith("("): command = PostUtils.fcoms(command, COMMENT) commandlist.append(command) diff --git a/src/Mod/CAM/Path/Post/scripts/dynapath_4060_post.py b/src/Mod/CAM/Path/Post/scripts/dynapath_4060_post.py index f7861567f3..ebfb2025fd 100644 --- a/src/Mod/CAM/Path/Post/scripts/dynapath_4060_post.py +++ b/src/Mod/CAM/Path/Post/scripts/dynapath_4060_post.py @@ -401,7 +401,7 @@ def parse(pathobj): if command == lastcommand: outstring.pop(0) - if c.Name[0] == "(" and not OUTPUT_COMMENTS: # command is a comment + if c.Name.startswith("(") and not OUTPUT_COMMENTS: # command is a comment continue # Now add the remaining parameters in order diff --git a/src/Mod/CAM/Path/Post/scripts/fablin_post.py b/src/Mod/CAM/Path/Post/scripts/fablin_post.py index 73c4e640e3..165fe4df51 100644 --- a/src/Mod/CAM/Path/Post/scripts/fablin_post.py +++ b/src/Mod/CAM/Path/Post/scripts/fablin_post.py @@ -251,7 +251,7 @@ def parse(pathobj): command = c.Name # fablin does not support parenthesis syntax, so removing that (pocket) in the agnostic gcode - if command[0] == "(": + if command.startswith("("): if not OUTPUT_COMMENTS: pass else: diff --git a/src/Mod/CAM/Path/Post/scripts/fangling_post.py b/src/Mod/CAM/Path/Post/scripts/fangling_post.py index c6938c66b5..8d2a50c237 100644 --- a/src/Mod/CAM/Path/Post/scripts/fangling_post.py +++ b/src/Mod/CAM/Path/Post/scripts/fangling_post.py @@ -411,7 +411,7 @@ def parse(pathobj): if command == lastcommand: outstring.pop(0) - if c.Name[0] == "(" and not OUTPUT_COMMENTS: # command is a comment + if c.Name.startswith("(") and not OUTPUT_COMMENTS: # command is a comment continue # Now add the remaining parameters in order diff --git a/src/Mod/CAM/Path/Post/scripts/fanuc_post.py b/src/Mod/CAM/Path/Post/scripts/fanuc_post.py index 4487f70457..e6b51e2a80 100644 --- a/src/Mod/CAM/Path/Post/scripts/fanuc_post.py +++ b/src/Mod/CAM/Path/Post/scripts/fanuc_post.py @@ -504,7 +504,7 @@ def parse(pathobj): if command == "G80" and lastcommand == nextcommand: continue - if c.Name[0] == "(" and not OUTPUT_COMMENTS: # command is a comment + if c.Name.startswith("(") and not OUTPUT_COMMENTS: # command is a comment continue # Now add the remaining parameters in order diff --git a/src/Mod/CAM/Path/Post/scripts/jtech_post.py b/src/Mod/CAM/Path/Post/scripts/jtech_post.py index 35e12487ea..3fd943a108 100644 --- a/src/Mod/CAM/Path/Post/scripts/jtech_post.py +++ b/src/Mod/CAM/Path/Post/scripts/jtech_post.py @@ -313,7 +313,7 @@ def parse(pathobj): if command == lastcommand: outstring.pop(0) - if c.Name[0] == "(" and not OUTPUT_COMMENTS: # command is a comment + if c.Name.startswith("(") and not OUTPUT_COMMENTS: # command is a comment continue # Now add the remaining parameters in order diff --git a/src/Mod/CAM/Path/Post/scripts/linuxcnc_post.py b/src/Mod/CAM/Path/Post/scripts/linuxcnc_post.py index 5a0e676936..84f4d32551 100644 --- a/src/Mod/CAM/Path/Post/scripts/linuxcnc_post.py +++ b/src/Mod/CAM/Path/Post/scripts/linuxcnc_post.py @@ -355,7 +355,7 @@ def parse(pathobj): if command == lastcommand: outstring.pop(0) - if c.Name[0] == "(" and not OUTPUT_COMMENTS: # command is a comment + if c.Name.startswith("(") and not OUTPUT_COMMENTS: # command is a comment continue # Now add the remaining parameters in order diff --git a/src/Mod/CAM/Path/Post/scripts/mach3_mach4_post.py b/src/Mod/CAM/Path/Post/scripts/mach3_mach4_post.py index a450895333..7a8909ed09 100644 --- a/src/Mod/CAM/Path/Post/scripts/mach3_mach4_post.py +++ b/src/Mod/CAM/Path/Post/scripts/mach3_mach4_post.py @@ -387,7 +387,7 @@ def parse(pathobj): if command == lastcommand: outstring.pop(0) - if c.Name[0] == "(" and not OUTPUT_COMMENTS: # command is a comment + if c.Name.startswith("(") and not OUTPUT_COMMENTS: # command is a comment continue # Now add the remaining parameters in order diff --git a/src/Mod/CAM/Path/Post/scripts/opensbp_post.py b/src/Mod/CAM/Path/Post/scripts/opensbp_post.py index 45fa861a23..7fac68914d 100644 --- a/src/Mod/CAM/Path/Post/scripts/opensbp_post.py +++ b/src/Mod/CAM/Path/Post/scripts/opensbp_post.py @@ -359,7 +359,7 @@ def parse(pathobj): output += scommands[command](c) if c.Parameters: CurrentState.update(c.Parameters) - elif command[0] == "(": + elif command.startswith("("): output += "' " + command + "\n" else: print("I don't know what the hell the command: ", end="") diff --git a/src/Mod/CAM/Path/Post/scripts/philips_post.py b/src/Mod/CAM/Path/Post/scripts/philips_post.py index 9a67cb7957..3389302605 100644 --- a/src/Mod/CAM/Path/Post/scripts/philips_post.py +++ b/src/Mod/CAM/Path/Post/scripts/philips_post.py @@ -412,7 +412,7 @@ def export(objectslist, filename, argstring): command = command.replace("G0", "G") # normalize: G01 -> G1 if command != UNITS or UNITS_INCLUDED: - if command[0] == "(": + if command.startswith("("): command = PostUtils.fcoms(command, COMMENT) # the mapping is done for output only! For internal things we # still use the old value. diff --git a/src/Mod/CAM/Path/Post/scripts/uccnc_post.py b/src/Mod/CAM/Path/Post/scripts/uccnc_post.py index b44a77c506..2ee54ecd0e 100644 --- a/src/Mod/CAM/Path/Post/scripts/uccnc_post.py +++ b/src/Mod/CAM/Path/Post/scripts/uccnc_post.py @@ -599,7 +599,7 @@ def parse(pathobj): if command == lastcommand: commandlist.pop(0) - if c.Name[0] == "(" and not OUTPUT_COMMENTS: # command is a comment + if c.Name.startswith("(") and not OUTPUT_COMMENTS: # command is a comment continue # Now add the remaining parameters in order diff --git a/src/Mod/CAM/Path/Post/scripts/wedm_post.py b/src/Mod/CAM/Path/Post/scripts/wedm_post.py index 1b9396f8b9..fe3e134f7e 100644 --- a/src/Mod/CAM/Path/Post/scripts/wedm_post.py +++ b/src/Mod/CAM/Path/Post/scripts/wedm_post.py @@ -456,7 +456,7 @@ def parse(pathobj): if command == lastcommand: outstring.pop(0) - if command[0] == "(": # command is a comment + if command.startswith("("): # command is a comment if OUTPUT_COMMENTS: # Edit comment with COMMENT_CHAR outstring.insert(0, COMMENT_CHAR) else: