diff --git a/development_iskeyfree.py b/development_iskeyfree.py index e8215497113935d28913d62f97ba520168b46610..c2c338f4c075058c00b6e48edcbb3ea082207301 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 8ea8cf9fb1e3d0c03f8642fb51171779bfa87f92..f92d940fa4fd66b7fbd9ebe98392abba8713055f 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("((?<!\w)\w)|\d") +first_letters.pattern = re_compile(r"((?<!\w)\w)|\d") def is_upsidedown_wrong(name): diff --git a/io_import_dxf/dxfimport/do.py b/io_import_dxf/dxfimport/do.py index 127160c04a1ff871a3132634bb39db2866ff33dd..65f9c079121b0e2de009a004c2cc5ded81191766 100644 --- a/io_import_dxf/dxfimport/do.py +++ b/io_import_dxf/dxfimport/do.py @@ -1637,7 +1637,7 @@ class Do: if type(self.pScene) is TransverseMercator: scene['SRID'] = "tmerc" elif self.pScene is not None: # assume Proj - scene['SRID'] = re.findall("\+init=(.+)\s", self.pScene.srs)[0] + scene['SRID'] = re.findall(r"\+init=(.+)\s", self.pScene.srs)[0] #bpy.context.screen.scene = scene diff --git a/lighting_dynamic_sky.py b/lighting_dynamic_sky.py index 1b22a3a432a1e3461951610a0f67e116c6ba3fef..4152277d555b309586a4ff4031dc838e9a9c7eb2 100644 --- a/lighting_dynamic_sky.py +++ b/lighting_dynamic_sky.py @@ -60,7 +60,7 @@ def check_world_name(name_id="Dynamic"): test_num = [] from re import findall for words in name_list: - test_num.append(findall("\d+", words)) + test_num.append(findall(r"\d+", words)) suffix += max([int(l[-1]) for l in test_num]) new_name = "{}_{}".format(name_id, suffix) diff --git a/mesh_inset/offset.py b/mesh_inset/offset.py index 3c6a7c76e9ce73934ec32634a14805d0c1803d89..6bc817875d3cb82b4a90a5a12d701ca479e280e3 100644 --- a/mesh_inset/offset.py +++ b/mesh_inset/offset.py @@ -576,7 +576,7 @@ class Offset(object): return ans def SplitJoinFaces(self, newfaces, ev): - """Use event ev to split or join faces. + r"""Use event ev to split or join faces. Given ev, an edge event, use the ev spoke to split the other spoke's inner edge. diff --git a/node_wrangler.py b/node_wrangler.py index 1cfb9bbd70ad3e5a119d7ab823e9b06e93ce3514..fd29a46bfcbaaa6add743bdf03eeb3fe53003c53 100644 --- a/node_wrangler.py +++ b/node_wrangler.py @@ -3221,7 +3221,7 @@ class NWAddPrincipledSetup(Operator, NWBase, ImportHelper): # Remove digits fname = ''.join(i for i in fname if not i.isdigit()) # Separate CamelCase by space - fname = re.sub("([a-z])([A-Z])","\g<1> \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 a2d9a5d14ca637b2651348e6ae7767a03fa5310b..501c335fadfcaded7baaa6bc51a612d32de0f574 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 312ecf5643f5c328ceeaaa4a538ade9aa1bdedea..32d013a75e9253b80f5623477f92c9764d29b898 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 47d5eaf3584bbe3953be06f3a4aae39b5d3eca4e..7573e4a71d962441eb610a4d13d115482bd1e10a 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 59c27e3926e125487004e36aa6f8e0102a40c162..72404195530048a7a119fdb4fedf3d8a614cc1b2 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):