mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 23:23:57 -06:00
Remove trailing whitespace from Python files
This commit is contained in:
parent
1e33360c35
commit
89f0970a88
157 changed files with 562 additions and 562 deletions
|
@ -132,7 +132,7 @@ class PostProcessingPlugin(QObject, Extension):
|
|||
|
||||
def loadAllScripts(self) -> None:
|
||||
"""Load all scripts from all paths where scripts can be found.
|
||||
|
||||
|
||||
This should probably only be done on init.
|
||||
"""
|
||||
|
||||
|
@ -157,7 +157,7 @@ class PostProcessingPlugin(QObject, Extension):
|
|||
|
||||
def loadScripts(self, path: str) -> None:
|
||||
"""Load all scripts from provided path.
|
||||
|
||||
|
||||
This should probably only be done on init.
|
||||
:param path: Path to check for scripts.
|
||||
"""
|
||||
|
@ -360,7 +360,7 @@ class PostProcessingPlugin(QObject, Extension):
|
|||
|
||||
def _propertyChanged(self) -> None:
|
||||
"""Property changed: trigger re-slice
|
||||
|
||||
|
||||
To do this we use the global container stack propertyChanged.
|
||||
Re-slicing is necessary for setting changes in this plugin, because the changes
|
||||
are applied only once per "fresh" gcode
|
||||
|
|
|
@ -81,7 +81,7 @@ class Script:
|
|||
|
||||
def getSettingData(self) -> Dict[str, Any]:
|
||||
"""Needs to return a dict that can be used to construct a settingcategory file.
|
||||
|
||||
|
||||
See the example script for an example.
|
||||
It follows the same style / guides as the Uranium settings.
|
||||
Scripts can either override getSettingData directly, or use getSettingDataString
|
||||
|
@ -116,7 +116,7 @@ class Script:
|
|||
|
||||
def getValue(self, line: str, key: str, default = None) -> Any:
|
||||
"""Convenience function that finds the value in a line of g-code.
|
||||
|
||||
|
||||
When requesting key = x from line "G1 X100" the value 100 is returned.
|
||||
"""
|
||||
if not key in line or (';' in line and line.find(key) > line.find(';')):
|
||||
|
@ -135,7 +135,7 @@ class Script:
|
|||
|
||||
def putValue(self, line: str = "", **kwargs) -> str:
|
||||
"""Convenience function to produce a line of g-code.
|
||||
|
||||
|
||||
You can put in an original g-code line and it'll re-use all the values
|
||||
in that line.
|
||||
All other keyword parameters are put in the result in g-code's format.
|
||||
|
@ -190,7 +190,7 @@ class Script:
|
|||
|
||||
def execute(self, data: List[str]) -> List[str]:
|
||||
"""This is called when the script is executed.
|
||||
|
||||
|
||||
It gets a list of g-code strings and needs to return a (modified) list.
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
# Uses -
|
||||
# M163 - Set Mix Factor
|
||||
# M164 - Save Mix - saves to T2 as a unique mix
|
||||
|
||||
|
||||
import re #To perform the search and replace.
|
||||
from ..Script import Script
|
||||
|
||||
|
@ -127,7 +127,7 @@ class ColorMix(Script):
|
|||
firstMix = self.getSettingValueByKey("mix_start")
|
||||
secondMix = self.getSettingValueByKey("mix_finish")
|
||||
modelOfInterest = self.getSettingValueByKey("object_number")
|
||||
|
||||
|
||||
#get layer height
|
||||
layerHeight = 0
|
||||
for active_layer in data:
|
||||
|
@ -138,11 +138,11 @@ class ColorMix(Script):
|
|||
break
|
||||
if layerHeight != 0:
|
||||
break
|
||||
|
||||
|
||||
#default layerHeight if not found
|
||||
if layerHeight == 0:
|
||||
layerHeight = .2
|
||||
|
||||
|
||||
#get layers to use
|
||||
startLayer = 0
|
||||
endLayer = 0
|
||||
|
|
|
@ -56,7 +56,7 @@ class DisplayFilenameAndLayerOnLCD(Script):
|
|||
}
|
||||
}
|
||||
}"""
|
||||
|
||||
|
||||
def execute(self, data):
|
||||
max_layer = 0
|
||||
if self.getSettingValueByKey("name") != "":
|
||||
|
@ -96,5 +96,5 @@ class DisplayFilenameAndLayerOnLCD(Script):
|
|||
i += 1
|
||||
final_lines = "\n".join(lines)
|
||||
data[layer_index] = final_lines
|
||||
|
||||
|
||||
return data
|
||||
|
|
|
@ -65,7 +65,7 @@ class FilamentChange(Script):
|
|||
|
||||
def execute(self, data: List[str]):
|
||||
"""Inserts the filament change g-code at specific layer numbers.
|
||||
|
||||
|
||||
:param data: A list of layers of g-code.
|
||||
:return: A similar list, with filament change commands inserted.
|
||||
"""
|
||||
|
|
|
@ -8,7 +8,7 @@ from ..Script import Script
|
|||
|
||||
class SearchAndReplace(Script):
|
||||
"""Performs a search-and-replace on all g-code.
|
||||
|
||||
|
||||
Due to technical limitations, the search can't cross the border between
|
||||
layers.
|
||||
"""
|
||||
|
|
|
@ -30,7 +30,7 @@ class UsePreviousProbeMeasurements(Script):
|
|||
}
|
||||
}
|
||||
}"""
|
||||
|
||||
|
||||
def execute(self, data):
|
||||
text = "M501 ;load bed level data\nM420 S1 ;enable bed leveling"
|
||||
if self.getSettingValueByKey("use_previous_measurements"):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue