From 29a320b4a2488aac87f8441f65e1c154b5392fa8 Mon Sep 17 00:00:00 2001 From: Robert Martens Date: Sat, 23 Mar 2013 18:39:33 -0400 Subject: [PATCH] Remove regex parameter from fix_plane --- vertalert.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vertalert.py b/vertalert.py index 8ab3f65..69fe496 100644 --- a/vertalert.py +++ b/vertalert.py @@ -48,7 +48,7 @@ def get_max_dev(planes, snap): return max(devs) -def fix_plane(plane, regex, thresh, snaplo, snaphi): +def fix_plane(plane, thresh, snaplo, snaphi): """ Use 'regex' pattern to find floating point coordinates in 'plane', round to nearest integer, and return corrected plane string. @@ -58,7 +58,7 @@ def fix_plane(plane, regex, thresh, snaplo, snaphi): regex: Regular Expression pattern to use for search """ - floats = re.findall(regex, plane) + floats = re.findall(r'-?\d+\.\d+e?-?\d*', plane) plane_new = plane for coord in floats: orig = decimal.Decimal(coord) @@ -107,7 +107,7 @@ def fix_brushes(brushes, thresh, vmf_in, snaplo, snaphi): if max_dev < thresh or snaphi is not None: brush_new = brush for plane in float_planes: - plane_new = fix_plane(plane, r'-?\d+\.\d+e?-?\d*', thresh, snaplo, snaphi) + plane_new = fix_plane(plane, thresh, snaplo, snaphi) brush_new = brush_new.replace(plane, plane_new) vmf_out = vmf_out.replace(brush, brush_new) rounded_count += 1