void-packages/srcpkgs/eolie/patches/re-raw.patch

58 lines
2.3 KiB
Diff

--- a/eolie/css_rule_import.py
+++ b/eolie/css_rule_import.py
@@ -32,7 +32,7 @@ class CSSImportRule:
self.__stylesheet = None
try:
parsed = urlparse(uri)
- search = re.search('@import url\(["\']?([^"\')]*)', css)
+ search = re.search(r'@import url\(["\']?([^"\')]*)', css)
css = search.group(1)
if css.startswith(".."):
path_split = parsed.path.split("/")
--- a/eolie/css_rule_list.py
+++ b/eolie/css_rule_list.py
@@ -35,7 +35,7 @@ class CSSRuleList:
for child in self.__get_children(css):
child = child.strip()
# Remove any comment
- child = re.sub("\/\*[^*]*[^/]*\*\/", "", child)
+ child = re.sub(r"\/\*[^*]*[^/]*\*\/", "", child)
if child.startswith("@media"):
rule = CSSMediaRule(child, uri, cancellable)
elif child.startswith("@supports"):
--- a/eolie/css_rule_style.py
+++ b/eolie/css_rule_style.py
@@ -121,7 +121,7 @@ class CSSStyleRule:
@return str
"""
value = re.sub('[ ]*!.*important', '', value)
- value = re.sub('url.*\([^\)]*\)', 'url()', value)
+ value = re.sub(r'url.*\([^\)]*\)', 'url()', value)
return value.strip()
def __contains_color(self, value):
@@ -228,9 +228,9 @@ class CSSStyleRule:
"""
results = {}
# Extract values from rgb() and rgba()
- colors = re.findall('(rgb.?\([^\)]*\))', rule)
+ colors = re.findall(r'(rgb.?\([^\)]*\))', rule)
for color in colors:
- color_tuple = re.search('rgb.?\(([^\)]*)', color)
+ color_tuple = re.search(r'rgb.?\(([^\)]*)', color)
if color_tuple is None:
continue
split = self.__get_split(color_tuple[1])
@@ -251,9 +251,9 @@ class CSSStyleRule:
"""
results = {}
# Extract values from hsl() and hsla()
- colors = re.findall('(hsl.?\([^\)]*\))', rule)
+ colors = re.findall(r'(hsl.?\([^\)]*\))', rule)
for color in colors:
- color_tuple = re.search('hsl.?\(([^\)]*)', color)
+ color_tuple = re.search(r'hsl.?\(([^\)]*)', color)
if color_tuple is None:
continue
split = self.__get_split(color_tuple[1])