+8
-19
lines changedFilter options
+8
-19
lines changed Original file line number Diff line number Diff line change
@@ -238,7 +238,4 @@ def quit(self) -> None:
238
238
self.service.stop()
239
239
240
240
def create_options(self) -> BaseOptions:
241
-
if self.vendor_prefix == "ms":
242
-
return EdgeOptions()
243
-
else:
244
-
return ChromeOptions()
241
+
return EdgeOptions() if self.vendor_prefix == "ms" else ChromeOptions()
Original file line number Diff line number Diff line change
@@ -126,8 +126,7 @@ def send_remote_shutdown_command(self):
126
126
for x in range(30):
127
127
if not self.is_connectable():
128
128
break
129
-
else:
130
-
sleep(1)
129
+
sleep(1)
131
130
132
131
def stop(self):
133
132
"""
Original file line number Diff line number Diff line change
@@ -99,8 +99,7 @@ def script(self, _script: float) -> None:
99
99
def _convert(self, timeout: float) -> int:
100
100
if isinstance(timeout, (int, float)):
101
101
return int(float(timeout) * 1000)
102
-
else:
103
-
raise TypeError("Timeouts can only be an int or a float")
102
+
raise TypeError("Timeouts can only be an int or a float")
104
103
105
104
def _to_json(self) -> JSONTimeouts:
106
105
timeouts: JSONTimeouts = {}
Original file line number Diff line number Diff line change
@@ -126,10 +126,7 @@ def is_url_connectable(port: Union[int, str]) -> bool:
126
126
127
127
try:
128
128
res = url_request.urlopen("http://127.0.0.1:%s/status" % port)
129
-
if res.getcode() == 200:
130
-
return True
131
-
else:
132
-
return False
129
+
return res.getcode() == 200
133
130
except Exception:
134
131
return False
135
132
Original file line number Diff line number Diff line change
@@ -402,9 +402,8 @@ def _request(self, method, url, body=None):
402
402
if 'value' not in data:
403
403
data['value'] = None
404
404
return data
405
-
else:
406
-
data = {'status': 0, 'value': data}
407
-
return data
405
+
data = {'status': 0, 'value': data}
406
+
return data
408
407
finally:
409
408
LOGGER.debug("Finished Request")
410
409
response.close()
Original file line number Diff line number Diff line change
@@ -253,8 +253,7 @@ def __init__(self, command_executor='http://127.0.0.1:4444',
253
253
if desired_capabilities:
254
254
if not isinstance(desired_capabilities, dict):
255
255
raise WebDriverException("Desired Capabilities must be a dictionary")
256
-
else:
257
-
capabilities.update(desired_capabilities)
256
+
capabilities.update(desired_capabilities)
258
257
self.command_executor = command_executor
259
258
if isinstance(self.command_executor, (str, bytes)):
260
259
self.command_executor = get_remote_connection(capabilities, command_executor=command_executor,
@@ -329,8 +328,7 @@ def name(self) -> str:
329
328
"""
330
329
if 'browserName' in self.caps:
331
330
return self.caps['browserName']
332
-
else:
333
-
raise KeyError('browserName not specified in session capabilities')
331
+
raise KeyError('browserName not specified in session capabilities')
334
332
335
333
def start_client(self):
336
334
"""
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4