Skip to content

Commit

Permalink
Merge pull request #416 from Syres916/patch-10
Browse files Browse the repository at this point in the history
Python 3.12.x fixes
  • Loading branch information
shaise authored Dec 4, 2024
2 parents 2edecbc + 32865ed commit f584135
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions SheetMetalKfactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def _find_objects(objs, _filter):


def getSpreadSheetNames():
material_sheet_regex_str = "material_([a-zA-Z0-9_\-\[\]\.]+)"
material_sheet_regex_str = r"material_([a-zA-Z0-9_\-\[\]\.]+)"
material_sheet_regex = re.compile(material_sheet_regex_str)

spreadsheets = findObjectsByTypeRecursive(
Expand All @@ -88,7 +88,7 @@ def getSpreadSheetNames():


class KFactorLookupTable:
cell_regex = re.compile("^([A-Z]+)([0-9]+)$")
cell_regex = re.compile(r"^([A-Z]+)([0-9]+)$")

def __init__(self, material_sheet):
lookup_sheet = FreeCAD.ActiveDocument.getObjectsByLabel(material_sheet)
Expand Down Expand Up @@ -152,7 +152,7 @@ def find_k_factor_cell(self, sheet):
if content == "Radius / Thickness":
key_cell = cell
try:
m = re.search("(K-[fF]actor)\s?\(?([a-zA-Z]*)\)?", content)
m = re.search(r"(K-[fF]actor)\s?\(?([a-zA-Z]*)\)?", content)
if m:
value_cell = cell
k_factor_standard = m.group(2).lower() or None
Expand Down

0 comments on commit f584135

Please sign in to comment.