From a444e8cc19a4353ce35ecdec9bb7894ee73a204a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 1 Dec 2021 11:05:16 +1100 Subject: [PATCH] Cleanup: quiet character escape warnings --- development_iskeyfree.py | 2 +- io_export_paper_model.py | 2 +- io_import_dxf/dxfimport/do.py | 2 +- lighting_dynamic_sky.py | 2 +- mesh_inset/offset.py | 2 +- node_wrangler.py | 2 +- rigify/generate.py | 2 +- rigify/rigs/faces/super_face.py | 4 ++-- rigify/rigs/limbs/super_palm.py | 2 +- sun_position/geo.py | 18 +++++++++--------- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/development_iskeyfree.py b/development_iskeyfree.py index e8215497..c2c338f4 100644 --- a/development_iskeyfree.py +++ b/development_iskeyfree.py @@ -509,7 +509,7 @@ class IsKeyFreeRunExportKeys(Operator): if new_name in list_txt: from re import findall - test_num = [findall("\d+", words) for words in list_txt] + test_num = [findall(r"\d+", words) for words in list_txt] suffix += max([int(l[-1]) for l in test_num]) new_name = "{}_{}{}".format(def_name, suffix, ext) return new_name diff --git a/io_export_paper_model.py b/io_export_paper_model.py index 8ea8cf9f..f92d940f 100644 --- a/io_export_paper_model.py +++ b/io_export_paper_model.py @@ -61,7 +61,7 @@ def first_letters(text): """Iterator over the first letter of each word""" for match in first_letters.pattern.finditer(text): yield text[match.start()] -first_letters.pattern = re_compile("((? \g<2>",fname) + fname = re.sub(r"([a-z])([A-Z])", r"\g<1> \g<2>",fname) # Replace common separators with SPACE seperators = ['_', '.', '-', '__', '--', '#'] for sep in seperators: diff --git a/rigify/generate.py b/rigify/generate.py index a2d9a5d1..501c335f 100644 --- a/rigify/generate.py +++ b/rigify/generate.py @@ -258,7 +258,7 @@ class Generator(base_generate.BaseGenerator): for tar in var.targets: # If a custom property if var.type == 'SINGLE_PROP' \ - and re.match('^pose.bones\["[^"\]]*"\]\["[^"\]]*"\]$', tar.data_path): + and re.match(r'^pose.bones\["[^"\]]*"\]\["[^"\]]*"\]$', tar.data_path): tar.data_path = "RIGIFY-" + tar.data_path diff --git a/rigify/rigs/faces/super_face.py b/rigify/rigs/faces/super_face.py index 312ecf56..32d013a7 100644 --- a/rigify/rigs/faces/super_face.py +++ b/rigify/rigs/faces/super_face.py @@ -71,8 +71,8 @@ class Rig: # RE pattern match right or left parts # match the letter "L" (or "R"), followed by an optional dot (".") # and 0 or more digits at the end of the the string - left_pattern = 'L\.?\d*$' - right_pattern = 'R\.?\d*$' + left_pattern = r'L\.?\d*$' + right_pattern = r'R\.?\d*$' left = sorted( [ name for name in bones if re.search( left_pattern, name ) ] ) right = sorted( [ name for name in bones if re.search( right_pattern, name ) ] ) diff --git a/rigify/rigs/limbs/super_palm.py b/rigify/rigs/limbs/super_palm.py index 47d5eaf3..7573e4a7 100644 --- a/rigify/rigs/limbs/super_palm.py +++ b/rigify/rigs/limbs/super_palm.py @@ -77,7 +77,7 @@ class Rig(BaseRig): self.order = 'YXZ' if 'X' in self.palm_rotation_axis else 'YZX' # Figure out the name for the control bone (remove the last .##) - self.ctrl_name = re.sub("([0-9]+\.)", "", strip_org(self.bones.org[-1])[::-1], count=1)[::-1] + self.ctrl_name = re.sub(r"([0-9]+\.)", "", strip_org(self.bones.org[-1])[::-1], count=1)[::-1] def parent_bones(self): self.rig_parent_bone = self.get_bone_parent(self.bones.org[0]) diff --git a/sun_position/geo.py b/sun_position/geo.py index 59c27e39..72404195 100644 --- a/sun_position/geo.py +++ b/sun_position/geo.py @@ -51,7 +51,7 @@ class Parser: # build pattern with subgroups sub_dict = {} subpattern_names = [] - for s in re.finditer("%\(.*?\)s", self.raw_patterns[pattern_name]): + for s in re.finditer(r"%\(.*?\)s", self.raw_patterns[pattern_name]): subpattern_name = s.group()[2:-2] if not self.virtual[subpattern_name]: sub_dict[subpattern_name] = "(" + self.patterns[ @@ -108,7 +108,7 @@ position_parser.add("minutes", r"%(number)s\s*%(minutes_symbol)s") position_parser.add("seconds", r"%(number)s\s*%(seconds_symbol)s") position_parser.add( "degree_coordinates", - "(?:%(sign)s\s*)?%(degrees)s(?:[+\s]*%(minutes)s)?(?:[+\s]*%(seconds)s)?|(?:%(sign)s\s*)%(minutes)s(?:[+\s]*%(seconds)s)?|(?:%(sign)s\s*)%(seconds)s" + r"(?:%(sign)s\s*)?%(degrees)s(?:[+\s]*%(minutes)s)?(?:[+\s]*%(seconds)s)?|(?:%(sign)s\s*)%(minutes)s(?:[+\s]*%(seconds)s)?|(?:%(sign)s\s*)%(seconds)s" ) position_parser.add( @@ -119,13 +119,13 @@ position_parser.add( r"%(nmea_style)s|%(plain_degrees)s|%(degree_coordinates)s") position_parser.add( - "position", """\ -\s*%(direction_ns)s\s*%(coordinates_ns)s[,;\s]*%(direction_ew)s\s*%(coordinates_ew)s\s*|\ -\s*%(direction_ew)s\s*%(coordinates_ew)s[,;\s]*%(direction_ns)s\s*%(coordinates_ns)s\s*|\ -\s*%(coordinates_ns)s\s*%(direction_ns)s[,;\s]*%(coordinates_ew)s\s*%(direction_ew)s\s*|\ -\s*%(coordinates_ew)s\s*%(direction_ew)s[,;\s]*%(coordinates_ns)s\s*%(direction_ns)s\s*|\ -\s*%(coordinates_ns)s[,;\s]+%(coordinates_ew)s\s*\ -""") + "position", ( + r"\s*%(direction_ns)s\s*%(coordinates_ns)s[,;\s]*%(direction_ew)s\s*%(coordinates_ew)s\s*|" + r"\s*%(direction_ew)s\s*%(coordinates_ew)s[,;\s]*%(direction_ns)s\s*%(coordinates_ns)s\s*|" + r"\s*%(coordinates_ns)s\s*%(direction_ns)s[,;\s]*%(coordinates_ew)s\s*%(direction_ew)s\s*|" + r"\s*%(coordinates_ew)s\s*%(direction_ew)s[,;\s]*%(coordinates_ns)s\s*%(direction_ns)s\s*|" + r"\s*%(coordinates_ns)s[,;\s]+%(coordinates_ew)s\s*" + )) def get_number(b): -- 2.11.4.GIT