@@ -36,9 +36,18 @@ class WebDriver(RemoteWebDriver):
36
36
37
37
"""
38
38
39
- def __init__ (self , port = 0 , executable_path = DEFAULT_EXECUTABLE_PATH , reuse_service = False ,
40
- desired_capabilities = DEFAULT_SAFARI_CAPS , quiet = False ,
41
- keep_alive = True , service_args = None , options : Options = None , service : Service = None ):
39
+ def __init__ (
40
+ self ,
41
+ port = 0 ,
42
+ executable_path = DEFAULT_EXECUTABLE_PATH ,
43
+ reuse_service = False ,
44
+ desired_capabilities = DEFAULT_SAFARI_CAPS ,
45
+ quiet = False ,
46
+ keep_alive = True ,
47
+ service_args = None ,
48
+ options : Options = None ,
49
+ service : Service = None ,
50
+ ):
42
51
"""
43
52
44
53
Creates a new Safari driver instance and launches or finds a running safaridriver service.
@@ -55,28 +64,45 @@ def __init__(self, port=0, executable_path=DEFAULT_EXECUTABLE_PATH, reuse_servic
55
64
- service - Service object for handling the browser driver if you need to pass extra details
56
65
"""
57
66
if port :
58
- warnings .warn ("port has been deprecated, please set it via the service class" ,
59
- DeprecationWarning , stacklevel = 2 )
67
+ warnings .warn (
68
+ "port has been deprecated, please set it via the service class" , DeprecationWarning , stacklevel = 2
69
+ )
60
70
61
71
if executable_path != DEFAULT_EXECUTABLE_PATH :
62
- warnings .warn ("executable_path has been deprecated, please use the Options class to set it" ,
63
- DeprecationWarning , stacklevel = 2 )
72
+ warnings .warn (
73
+ "executable_path has been deprecated, please use the Options class to set it" ,
74
+ DeprecationWarning ,
75
+ stacklevel = 2 ,
76
+ )
64
77
if reuse_service :
65
- warnings .warn ("reuse_service has been deprecated, please use the Service class to set it" ,
66
- DeprecationWarning , stacklevel = 2 )
78
+ warnings .warn (
79
+ "reuse_service has been deprecated, please use the Service class to set it" ,
80
+ DeprecationWarning ,
81
+ stacklevel = 2 ,
82
+ )
67
83
if desired_capabilities != DEFAULT_SAFARI_CAPS :
68
- warnings .warn ("desired_capabilities has been deprecated, please use the Options class to set it" ,
69
- DeprecationWarning , stacklevel = 2 )
84
+ warnings .warn (
85
+ "desired_capabilities has been deprecated, please use the Options class to set it" ,
86
+ DeprecationWarning ,
87
+ stacklevel = 2 ,
88
+ )
70
89
if quiet :
71
- warnings .warn ("quiet has been deprecated, please use the Service class to set it" ,
72
- DeprecationWarning , stacklevel = 2 )
90
+ warnings .warn (
91
+ "quiet has been deprecated, please use the Service class to set it" , DeprecationWarning , stacklevel = 2
92
+ )
73
93
if not keep_alive :
74
- warnings .warn ("keep_alive has been deprecated, please use the Service class to set it" ,
75
- DeprecationWarning , stacklevel = 2 )
94
+ warnings .warn (
95
+ "keep_alive has been deprecated, please use the Service class to set it" ,
96
+ DeprecationWarning ,
97
+ stacklevel = 2 ,
98
+ )
76
99
77
100
if service_args :
78
- warnings .warn ("service_args has been deprecated, please use the Service class to set it" ,
79
- DeprecationWarning , stacklevel = 2 )
101
+ warnings .warn (
102
+ "service_args has been deprecated, please use the Service class to set it" ,
103
+ DeprecationWarning ,
104
+ stacklevel = 2 ,
105
+ )
80
106
81
107
self ._reuse_service = reuse_service
82
108
if service :
@@ -86,13 +112,9 @@ def __init__(self, port=0, executable_path=DEFAULT_EXECUTABLE_PATH, reuse_servic
86
112
if not reuse_service :
87
113
self .service .start ()
88
114
89
- executor = SafariRemoteConnection (remote_server_addr = self .service .service_url ,
90
- keep_alive = keep_alive )
115
+ executor = SafariRemoteConnection (remote_server_addr = self .service .service_url , keep_alive = keep_alive )
91
116
92
- super ().__init__ (
93
- command_executor = executor ,
94
- options = options ,
95
- desired_capabilities = desired_capabilities )
117
+ super ().__init__ (command_executor = executor , options = options , desired_capabilities = desired_capabilities )
96
118
97
119
self ._is_remote = False
98
120
0 commit comments