[damned-lies] Mark missing raw strings



commit 647403e01c3b2479c52fb0b9eb1fd7c6f7ea59b1
Author: Claude Paroz <claude 2xlibre net>
Date:   Wed Dec 4 14:23:42 2019 +0100

    Mark missing raw strings

 damnedlies/settings.py | 2 +-
 stats/doap.py          | 4 ++--
 stats/models.py        | 6 +++---
 stats/utils.py         | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/damnedlies/settings.py b/damnedlies/settings.py
index 3e5fa999..d96f0ece 100644
--- a/damnedlies/settings.py
+++ b/damnedlies/settings.py
@@ -75,7 +75,7 @@ SCRATCHDIR = ""
 POTDIR = os.path.join(SCRATCHDIR, "POT")
 
 # The regex is used to determine if the module is in the standard VCS of the project
-VCS_HOME_REGEX = "gitlab\.gnome\.org"
+VCS_HOME_REGEX = r"gitlab\.gnome\.org"
 VCS_HOME_WARNING = gettext_noop("This module is not part of the GNOME Git repository. Please check the 
module’s web page to see where to send translations.")
 
 # By default, Django stores files locally, using the MEDIA_ROOT and MEDIA_URL settings
diff --git a/stats/doap.py b/stats/doap.py
index 70f57b2b..182aab40 100644
--- a/stats/doap.py
+++ b/stats/doap.py
@@ -58,8 +58,8 @@ def update_doap_infos(module):
 
     # *********** Update maintainers
     def slugify(val):
-        value = re.sub('[^\w\s-]', '', val).strip().lower()
-        return re.sub('[-\s]+', '-', value)
+        value = re.sub(r'[^\w\s-]', '', val).strip().lower()
+        return re.sub(r'[-\s]+', '-', value)
     doap_maintainers = tree.parse_maintainers()
     current_maintainers = dict([(m.email or m.username, m) for m in module.maintainers.all()])
 
diff --git a/stats/models.py b/stats/models.py
index ffe132ce..c145b920 100644
--- a/stats/models.py
+++ b/stats/models.py
@@ -702,7 +702,7 @@ class Domain(models.Model):
         def extract_lang(path):
             path_str = str(path)
             start = len(str(base_path)) + self.layout.find('{lang}') + 1
-            return re.split('\.|/', path_str[start:])[0]
+            return re.split(r'\.|/', path_str[start:])[0]
 
         for item in base_path.glob(self.layout.replace('{lang}', '*')):
             flist.append((extract_lang(item), item))
@@ -786,7 +786,7 @@ class Domain(models.Model):
                 )
             if not potfile.exists():
                 # Try to get POT file from command output, with path relative to checkout root
-                m = re.search('([\w/-]*\.pot)', output)
+                m = re.search(r'([\w/-]*\.pot)', output)
                 if m:
                     potfile = current_branch.co_path / m.group(0)
                 else:
@@ -1939,4 +1939,4 @@ def try_int(value):
         return value
 
 def split_name(value):
-    return tuple(try_int(part) for part in re.split("[-\.]", value))
+    return tuple(try_int(part) for part in re.split(r"[-\.]", value))
diff --git a/stats/utils.py b/stats/utils.py
index 8f3cfa2a..16c99bd0 100644
--- a/stats/utils.py
+++ b/stats/utils.py
@@ -212,7 +212,7 @@ class MakefileWrapper:
                 non_terminated_content = ""
                 # Search for variable
                 for var in variables:
-                    match = re.search('%s\s*[=,]\s*"?([^"]*)"?' % var, line)
+                    match = re.search(r'%s\s*[=,]\s*"?([^"]*)"?' % var, line)
                     if match:
                         found = match.group(1)
                         break
@@ -339,7 +339,7 @@ class CMakefileWrapper(MakefileWrapper):
                 non_terminated_content = ""
                 # Search for variable
                 for var in variables:
-                    match = re.search('set\s*\(%s\s*([^\)]*)\)' % var, line)
+                    match = re.search(r'set\s*\(%s\s*([^\)]*)\)' % var, line)
                     if match:
                         found = match.group(1).strip()
                         break


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]