Skip to content

Commit efde13b

Browse files
committed
Refactoring
1 parent 1b3f77c commit efde13b

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

seleniumbase/utilities/selenium_ide/convert_ide.py

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -532,26 +532,29 @@ def main():
532532
continue
533533

534534
if in_inefficient_wait:
535-
data = re.match(r'''^\s*if self.is_element_present\("([\S\s]+)"\)'''
536-
r''': break\s*$''', line)
535+
data = re.match(
536+
r'''^\s*if self.is_element_present\("([\S\s]+)"\)'''
537+
r''': break\s*$''', line)
537538
if data:
538539
selector = data.group(1)
539540
command = '%sself.wait_for_element("%s")' % (
540541
whitespace, selector)
541542
seleniumbase_lines.append(command)
542543
continue
543544

544-
data = re.match(r'''^\s*if self.is_element_present\('([\S\s]+)'\)'''
545-
r''': break\s*$''', line)
545+
data = re.match(
546+
r'''^\s*if self.is_element_present\('([\S\s]+)'\)'''
547+
r''': break\s*$''', line)
546548
if data:
547549
selector = data.group(1)
548550
command = "%sself.wait_for_element('%s')" % (
549551
whitespace, selector)
550552
seleniumbase_lines.append(command)
551553
continue
552554

553-
data = re.match(r'''^\s*if self.is_link_text_present'''
554-
r'''\("([\S\s]+)"\): break\s*$''', line)
555+
data = re.match(
556+
r'''^\s*if self.is_link_text_present'''
557+
r'''\("([\S\s]+)"\): break\s*$''', line)
555558
if data:
556559
uni = ""
557560
if '(u"' in line:
@@ -576,9 +579,10 @@ def main():
576579
seleniumbase_lines = []
577580
num_lines = len(lines)
578581
for line_num in range(len(lines)):
579-
data = re.match(r'''^\s*self.wait_for_element'''
580-
r'''\((["|'])([\S\s]+)(["|'])\)'''
581-
r'''\s*$''', lines[line_num])
582+
data = re.match(
583+
r'''^\s*self.wait_for_element'''
584+
r'''\((["|'])([\S\s]+)(["|'])\)'''
585+
r'''\s*$''', lines[line_num])
582586
if data:
583587
# quote_type = data.group(1)
584588
selector = data.group(2)
@@ -603,9 +607,10 @@ def main():
603607
seleniumbase_lines = []
604608
num_lines = len(lines)
605609
for line_num in range(len(lines)):
606-
data = re.match(r'''^\s*self.wait_for_link_text'''
607-
r'''\((["|'])([\S\s]+)(["|'])\)'''
608-
r'''\s*$''', lines[line_num])
610+
data = re.match(
611+
r'''^\s*self.wait_for_link_text'''
612+
r'''\((["|'])([\S\s]+)(["|'])\)'''
613+
r'''\s*$''', lines[line_num])
609614
if data:
610615
# quote_type = data.group(1)
611616
link_text = data.group(2)

0 commit comments

Comments
 (0)