From 9e9e1b5b543dc900a3c3f2eaf35fb4bced8dcf64 Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Mon, 7 Dec 2020 13:13:34 -0600 Subject: [PATCH] [Draft] Fix airfoil data detection regex The regular expression that Draft's airfoil data importer uses did not allow for lowercase "e" when using scientific notation. This corrects that, and silences Python Developer Mode warnings about deprecated escape sequences by converting most of the regex to use raw strings. --- src/Mod/Draft/importAirfoilDAT.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Mod/Draft/importAirfoilDAT.py b/src/Mod/Draft/importAirfoilDAT.py index 4b19e34ab7..c49fa61efa 100644 --- a/src/Mod/Draft/importAirfoilDAT.py +++ b/src/Mod/Draft/importAirfoilDAT.py @@ -157,9 +157,9 @@ def process(doc, filename): with the parsed information. """ # Regex to identify data rows and throw away unused metadata - xval = '(?P(\-|\d*)\.\d+(E\-?\d+)?)' - yval = '(?P\-?\s*\d*\.\d+(E\-?\d+)?)' - _regex = '^\s*' + xval + '\,?\s*' + yval + '\s*$' + xval = r'(?P(\-|\d*)\.\d+([Ee]\-?\d+)?)' + yval = r'(?P\-?\s*\d*\.\d+([Ee]\-?\d+)?)' + _regex = r'^\s*' + xval + r'\,?\s*' + yval + r'\s*$' regex = re.compile(_regex) afile = pythonopen(filename, 'r')