Skip to content

Commit efd408b

Browse files
committed
Flake8 refactoring
1 parent f55e55d commit efd408b

File tree

7 files changed

+25
-23
lines changed

7 files changed

+25
-23
lines changed

seleniumbase/common/encryption.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ def reverse_shuffle_string(string):
4545
return string
4646
new_string = ""
4747
odd = (len(string) % 2 == 1)
48-
part1 = string[:int(len(string)/2):1]
49-
part2 = string[int(len(string)/2)::1]
48+
part1 = string[:int(len(string) / 2):1]
49+
part2 = string[int(len(string) / 2)::1]
5050
for c in range(len(part1)):
5151
new_string += part2[c]
5252
new_string += part1[c]
@@ -118,18 +118,18 @@ def decrypt(string):
118118
rem4 = (len(string) + ord_string_sum(string)) % 2
119119
if len(string) % 2 != 0:
120120
if rem3 == 1:
121-
string = (chr(ord(string[-1])-5-rem1) + string +
122-
chr(ord(string[-1])-13-rem1))
121+
string = (chr(ord(string[-1]) - 5 - rem1) + string +
122+
chr(ord(string[-1]) - 13 - rem1))
123123
else:
124-
string = (chr(ord(string[-1])-11-rem1) + string +
125-
chr(ord(string[-1])-23-rem1))
124+
string = (chr(ord(string[-1]) - 11 - rem1) + string +
125+
chr(ord(string[-1]) - 23 - rem1))
126126
elif len(string) > 1:
127127
if rem4 == 1:
128-
string = (chr(ord(string[0])-19+rem2) + string +
129-
chr(ord(string[0])-7-rem2))
128+
string = (chr(ord(string[0]) - 19 + rem2) + string +
129+
chr(ord(string[0]) - 7 - rem2))
130130
else:
131-
string = (chr(ord(string[0])-26+rem2) + string +
132-
chr(ord(string[0])-12-rem2))
131+
string = (chr(ord(string[0]) - 26 + rem2) + string +
132+
chr(ord(string[0]) - 12 - rem2))
133133
rem5 = (len(string) + ord_string_sum(string)) % 23
134134
string = rotate(string, rem5)
135135
result = str_xor(shuffle_string(string)[::-1], xor_key)

seleniumbase/console_scripts/sb_install.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def main():
6262
invalid_run_command()
6363
else:
6464
invalid_run_command()
65-
name = sys.argv[num_args-1]
65+
name = sys.argv[num_args - 1]
6666

6767
file_name = None
6868
download_url = None

seleniumbase/console_scripts/sb_mkdir.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def main():
4040
invalid_run_command()
4141
else:
4242
invalid_run_command()
43-
dir_name = sys.argv[num_args-1]
43+
dir_name = sys.argv[num_args - 1]
4444
if len(str(dir_name)) < 2:
4545
raise Exception('Directory name length must be at least 2 '
4646
'characters long!')

seleniumbase/core/style_sheet.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<title>Test Report</title>
33
<link rel="SHORTCUT ICON"
44
href="%s" /> ''' % (
5-
"https://raw.githubusercontent.com/seleniumbase/SeleniumBase"
6-
"/master/seleniumbase/resources/favicon.ico")
5+
"https://raw.githubusercontent.com/seleniumbase/SeleniumBase"
6+
"/master/seleniumbase/resources/favicon.ico")
77

88
style = title + '''<style type="text/css">
99
html {

seleniumbase/core/testcase_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def get_params(self):
8484
"total_execution_time": self.total_execution_time,
8585
"username": self.username,
8686
"guid": self.guid
87-
}
87+
}
8888

8989

9090
class TestcaseDataPayload:

seleniumbase/fixtures/xpath_to_css.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def _filter_xpath_grouping(xpath):
7070
index = xpath.rfind(')')
7171
if index == -1:
7272
raise XpathException("Invalid or unsupported Xpath: %s" % xpath)
73-
xpath = xpath[:index] + xpath[index+1:]
73+
xpath = xpath[:index] + xpath[index + 1:]
7474
return xpath
7575

7676

seleniumbase/plugins/pytest_plugin.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@ def pytest_addoption(parser):
2323
parser.addoption('--env', action='store',
2424
dest='environment',
2525
choices=(
26-
constants.Environment.QA,
27-
constants.Environment.STAGING,
28-
constants.Environment.PRODUCTION,
29-
constants.Environment.MASTER,
30-
constants.Environment.LOCAL,
31-
constants.Environment.TEST),
26+
constants.Environment.QA,
27+
constants.Environment.STAGING,
28+
constants.Environment.PRODUCTION,
29+
constants.Environment.MASTER,
30+
constants.Environment.LOCAL,
31+
constants.Environment.TEST
32+
),
3233
default=constants.Environment.TEST,
3334
help="The environment to run the tests in.")
3435
parser.addoption('--data', dest='data',
@@ -48,7 +49,8 @@ def pytest_addoption(parser):
4849
parser.addoption('--database_env', action='store',
4950
dest='database_env',
5051
choices=(
51-
'prod', 'qa', 'staging', 'test', 'local', 'master'),
52+
'prod', 'qa', 'staging', 'test', 'local', 'master'
53+
),
5254
default='test',
5355
help=optparse.SUPPRESS_HELP)
5456
parser.addoption('--with-s3_logging', action="store_true",

0 commit comments

Comments
 (0)