Browse Source

Simplify if/else statement

This deduplicates some code and makes it generally easier to read.

Contributes to issue CURA-8219.
Ghostkeeper 3 years ago
parent
commit
bed255ecb9
1 changed files with 2 additions and 4 deletions
  1. 2 4
      plugins/PostProcessingPlugin/scripts/FilamentChange.py

+ 2 - 4
plugins/PostProcessingPlugin/scripts/FilamentChange.py

@@ -91,9 +91,7 @@ class FilamentChange(Script):
 
         color_change = "M600"
 
-        if firmware_config:
-            color_change = color_change + " ; Generated by FilamentChange plugin\n"            
-        else:
+        if not firmware_config:
             if initial_retract is not None and initial_retract > 0.:
                 color_change = color_change + (" E%.2f" % initial_retract)
 
@@ -106,7 +104,7 @@ class FilamentChange(Script):
             if y_pos is not None:
                 color_change = color_change + (" Y%.2f" % y_pos)
                 
-            color_change = color_change + " ; Generated by FilamentChange plugin\n"
+        color_change = color_change + " ; Generated by FilamentChange plugin\n"
 
         layer_targets = layer_nums.split(",")
         if len(layer_targets) > 0: