Skip to content

Commit

Permalink
qtplasmac-materials: Change to raw strings to fix Python SyntaxWarning
Browse files Browse the repository at this point in the history
This commit just aligns master with the changes (ab2c16b and 8beac1b) made to this file in 2.9 (they were fixed different ways at different times).  Raw strings makes the intent easier to understand for future developers.
  • Loading branch information
snowgoer540 committed Nov 15, 2024
1 parent 86fe9e2 commit 3385223
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/emc/usr_intf/qtplasmac/qtplasmac-materials.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,40 +281,40 @@ def on_convert_clicked(self):
self.materialCutM = 'CUT_MODE = 1'
elif 'PlasmaTool' in line:
valid = True
elif line.startswith('Tool\\ number'):
elif line.startswith(r'Tool\ number'):
b = line.split('=')[1]
self.materialNum = f'[MATERIAL_NUMBER_{b.strip().replace("]","")}]'
elif line.startswith('Name='):
b = line.split('=', 1)[1]
self.materialName = f'NAME = {b.strip()}'
elif line.startswith('Kerf\\ width'):
elif line.startswith(r'Kerf\ width'):
b = line.split('=', 1)[1]
self.materialKerf = f'KERF_WIDTH = {float(b.strip()) / self.divisor:.{self.precision}f}'
elif line.startswith('Pierce\\ height'):
elif line.startswith(r'Pierce\ height'):
b = line.split('=', 1)[1]
self.materialPierceH = f'PIERCE_HEIGHT = {float(b.strip()) / self.divisor:.{self.precision}f}'
elif line.startswith('Pierce\\ delay'):
elif line.startswith(r'Pierce\ delay'):
b = line.split('=', 1)[1]
self.materialPierceD = f'PIERCE_DELAY = {b.strip()}'
elif line.startswith('Cut\\ height'):
elif line.startswith(r'Cut\ height'):
b = line.split('=', 1)[1]
self.materialCutH = f'CUT_HEIGHT = {float(b.strip()) / self.divisor:.{self.precision}f}'
elif line.startswith('Feed\\ rate'):
elif line.startswith(r'Feed\ rate'):
b = line.split('=', 1)[1]
self.materialCutS = f'CUT_SPEED = {float(b.strip()) / self.divisor:.0f}'
elif line.startswith('Cut\\ current') or (line.startswith('Preset\\ current') and self.materialCutA == 'CUT_AMPS = 0'):
elif line.startswith(r'Cut\ current') or (line.startswith(r'Preset\ current') and self.materialCutA == 'CUT_AMPS = 0'):
b = line.split('=', 1)[1]
self.materialCutA = f'CUT_AMPS = {b.strip()}'
elif line.startswith('Cut\\ voltage') or (line.startswith('Preset\\ volts') and self.materialCutV == 'CUT_VOLTS = 0'):
elif line.startswith(r'Cut\ voltage') or (line.startswith(r'Preset\ volts') and self.materialCutV == 'CUT_VOLTS = 0'):
b = line.split('=', 1)[1]
self.materialCutV = f'CUT_VOLTS = {b.strip()}'
elif line.startswith('Pause\\ at\\ end\\ of\\ cut'):
elif line.startswith(r'Pause\ at\ end\ of\ cut'):
b = line.split('=', 1)[1]
self.materialPauseE = f'PAUSE_AT_END = {b.strip()}'
elif line.startswith('Gas\\ pressure') or (line.startswith('Preset\\ Air\\ Pressure') and self.materialGasP == 'GAS_PRESSURE = 0'):
elif line.startswith(r'Gas\ pressure') or (line.startswith(r'Preset\ Air\ Pressure') and self.materialGasP == 'GAS_PRESSURE = 0'):
b = line.split('=', 1)[1]
self.materialGasp = f'GAS_PRESSURE = {b.strip()}'
elif line.startswith('Cut\\ mode') or (line.startswith('Preset\\ mode') and self.materialCutM == 'CUT_MODE = 1'):
elif line.startswith(r'Cut\ mode') or (line.startswith(r'Preset\ mode') and self.materialCutM == 'CUT_MODE = 1'):
b = line.split('=', 1)[1]
self.materialCutM = f'CUT_MODE = {b.strip()}'
count += 1
Expand Down

0 comments on commit 3385223

Please sign in to comment.