Skip to content

Commit 6963c2a

Browse files
committed
flake8 fixes
1 parent fc5becb commit 6963c2a

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

seleniumbase/fixtures/email_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ def fixup(text):
478478
except KeyError:
479479
pass
480480
return text # leave as is
481-
return re.sub("&#?\w+;", fixup, html)
481+
return re.sub(r"&#?\w+;", fixup, html)
482482

483483
def decode_quoted_printable(self, html):
484484
"""

seleniumbase/fixtures/xpath_to_css.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,27 @@
55
import re
66

77
_sub_regexes = {
8-
"tag": "([a-zA-Z][a-zA-Z0-9]{0,10}|\*)",
9-
"attribute": "[.a-zA-Z_:][-\w:.]*(\(\))?)",
10-
"value": "\s*[\w/:][-/\w\s,:;.]*"
8+
"tag": r"([a-zA-Z][a-zA-Z0-9]{0,10}|\*)",
9+
"attribute": r"[.a-zA-Z_:][-\w:.]*(\(\))?)",
10+
"value": r"\s*[\w/:][-/\w\s,:;.]*"
1111
}
1212

1313
_validation_re = (
14-
"(?P<node>"
15-
"("
16-
"^id\([\"\']?(?P<idvalue>%(value)s)[\"\']?\)"
17-
"|"
18-
"(?P<nav>//?)(?P<tag>%(tag)s)"
19-
"(\[("
20-
"(?P<matched>(?P<mattr>@?%(attribute)s=[\"\']"
21-
"(?P<mvalue>%(value)s))[\"\']"
22-
"|"
23-
"(?P<contained>contains\((?P<cattr>@?%(attribute)s,\s*[\"\']"
24-
"(?P<cvalue>%(value)s)[\"\']\))"
25-
")\])?"
26-
"(\[(?P<nth>\d)\])?"
27-
")"
28-
")" % _sub_regexes
14+
r"(?P<node>"
15+
r"("
16+
r"^id\([\"\']?(?P<idvalue>%(value)s)[\"\']?\)"
17+
r"|"
18+
r"(?P<nav>//?)(?P<tag>%(tag)s)"
19+
r"(\[("
20+
r"(?P<matched>(?P<mattr>@?%(attribute)s=[\"\']"
21+
r"(?P<mvalue>%(value)s))[\"\']"
22+
r"|"
23+
r"(?P<contained>contains\((?P<cattr>@?%(attribute)s,\s*[\"\']"
24+
r"(?P<cvalue>%(value)s)[\"\']\))"
25+
r")\])?"
26+
r"(\[(?P<nth>\d)\])?"
27+
r")"
28+
r")" % _sub_regexes
2929
)
3030

3131
prog = re.compile(_validation_re)
@@ -136,7 +136,7 @@ def convert_xpath_to_css(xpath):
136136

137137
css = _get_raw_css_from_xpath(xpath)
138138

139-
attribute_defs = re.findall('(\[\w+\=\S+\])', css)
139+
attribute_defs = re.findall(r'(\[\w+\=\S+\])', css)
140140
for attr_def in attribute_defs:
141141
if (attr_def.count('[') == 1 and attr_def.count(']') == 1 and
142142
attr_def.count('=') == 1 and attr_def.count('"') == 0 and

0 commit comments

Comments
 (0)