[Bf-extensions-cvs] [a18093e5] master: SVG: Cleanup, less ambiguous names for pre-compiled regex

Sergey Sharybin noreply at git.blender.org
Thu Sep 19 15:34:21 CEST 2019


Commit: a18093e58d33353c699b7858fbab4c620429c678
Author: Sergey Sharybin
Date:   Thu Sep 19 12:25:24 2019 +0200
Branches: master
https://developer.blender.org/rBAa18093e58d33353c699b7858fbab4c620429c678

SVG: Cleanup, less ambiguous names for pre-compiled regex

===================================================================

M	io_curve_svg/svg_util.py

===================================================================

diff --git a/io_curve_svg/svg_util.py b/io_curve_svg/svg_util.py
index 056a19a6..bacd6917 100644
--- a/io_curve_svg/svg_util.py
+++ b/io_curve_svg/svg_util.py
@@ -36,11 +36,11 @@ match_first_comma = r"^\s*(?=,)"
 match_comma_pair = r",\s*(?=,)"
 match_last_comma = r",\s*$"
 
-pattern = f"({match_number})|{match_first_comma}|{match_comma_pair}|{match_last_comma}"
-re_pattern = re.compile(pattern)
+array_of_floats_pattern = f"({match_number})|{match_first_comma}|{match_comma_pair}|{match_last_comma}"
+re_array_of_floats_pattern = re.compile(array_of_floats_pattern)
 
 def parse_array_of_floats(text):
-    elements = re_pattern.findall(text)
+    elements = re_array_of_floats_pattern.findall(text)
     return [value_to_float(v[0]) for v in elements]
 
 def value_to_float(value_encoded: str):



More information about the Bf-extensions-cvs mailing list