Skip to content

Commit 64c7599

Browse files
committed
replacing unformatted leftovers
1 parent 9f33617 commit 64c7599

File tree

1 file changed

+35
-26
lines changed

1 file changed

+35
-26
lines changed

py/selenium/webdriver/firefox/webdriver.py

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ def quit(self) -> None:
8686
self.service.stop()
8787

8888
def set_context(self, context) -> None:
89+
"""Sets the context that Selenium commands are running in.
90+
91+
Args:
92+
context: Context to set, should be one of CONTEXT_CHROME or CONTEXT_CONTENT.
93+
"""
8994
self.execute("SET_CONTEXT", {"context": context})
9095

9196
@contextmanager
@@ -94,11 +99,11 @@ def context(self, context):
9499
`with` statement. The state of the context on the server is saved
95100
before entering the block, and restored upon exiting it.
96101
97-
:param context: Context, may be one of the class properties
98-
`CONTEXT_CHROME` or `CONTEXT_CONTENT`.
99-
100-
Usage example::
102+
Args:
103+
context: Context, may be one of the class properties
104+
`CONTEXT_CHROME` or `CONTEXT_CONTENT`.
101105
106+
Example:
102107
with selenium.context(selenium.CONTEXT_CHROME):
103108
# chrome scope
104109
... do stuff ...
@@ -116,13 +121,15 @@ def install_addon(self, path, temporary=False) -> str:
116121
Returns identifier of installed addon. This identifier can later
117122
be used to uninstall addon.
118123
119-
:param temporary: allows you to load browser extensions temporarily during a session
120-
:param path: Absolute path to the addon that will be installed.
124+
Args:
125+
path: Absolute path to the addon that will be installed.
126+
temporary: Allows you to load browser extensions temporarily during a session.
121127
122-
:Usage:
123-
::
128+
Returns:
129+
Identifier of installed addon.
124130
125-
driver.install_addon("/path/to/firebug.xpi")
131+
Example:
132+
driver.install_addon("/path/to/firebug.xpi")
126133
"""
127134

128135
if os.path.isdir(path):
@@ -147,10 +154,11 @@ def install_addon(self, path, temporary=False) -> str:
147154
def uninstall_addon(self, identifier) -> None:
148155
"""Uninstalls Firefox addon using its identifier.
149156
150-
:Usage:
151-
::
157+
Args:
158+
identifier: The addon identifier to uninstall.
152159
153-
driver.uninstall_addon("[email protected]")
160+
Example:
161+
driver.uninstall_addon("[email protected]")
154162
"""
155163
self.execute("UNINSTALL_ADDON", {"id": identifier})
156164

@@ -163,10 +171,8 @@ def get_full_page_screenshot_as_file(self, filename) -> bool:
163171
filename: The full path you wish to save your screenshot to. This
164172
should end with a `.png` extension.
165173
166-
Usage:
167-
::
168-
169-
driver.get_full_page_screenshot_as_file("/Screenshots/foo.png")
174+
Example:
175+
driver.get_full_page_screenshot_as_file("/Screenshots/foo.png")
170176
"""
171177
if not filename.lower().endswith(".png"):
172178
warnings.warn(
@@ -192,40 +198,43 @@ def save_full_page_screenshot(self, filename) -> bool:
192198
filename: The full path you wish to save your screenshot to. This
193199
should end with a `.png` extension.
194200
195-
Usage:
196-
::
197-
198-
driver.save_full_page_screenshot("/Screenshots/foo.png")
201+
Example:
202+
driver.save_full_page_screenshot("/Screenshots/foo.png")
199203
"""
200204
return self.get_full_page_screenshot_as_file(filename)
201205

202206
def get_full_page_screenshot_as_png(self) -> bytes:
203207
"""Gets the full document screenshot of the current window as a binary
204208
data.
205209
206-
:Usage:
207-
::
210+
Returns:
211+
Binary data of the screenshot.
208212
209-
driver.get_full_page_screenshot_as_png()
213+
Example:
214+
driver.get_full_page_screenshot_as_png()
210215
"""
211216
return base64.b64decode(self.get_full_page_screenshot_as_base64().encode("ascii"))
212217

213218
def get_full_page_screenshot_as_base64(self) -> str:
214219
"""Gets the full document screenshot of the current window as a base64
215220
encoded string which is useful in embedded images in HTML.
216221
217-
:Usage:
218-
::
222+
Returns:
223+
Base64 encoded string of the screenshot.
219224
220-
driver.get_full_page_screenshot_as_base64()
225+
Example:
226+
driver.get_full_page_screenshot_as_base64()
221227
"""
222228
return self.execute("FULL_PAGE_SCREENSHOT")["value"]
223229

224230
def download_file(self, *args, **kwargs):
231+
"""Download file functionality is not implemented for Firefox driver."""
225232
raise NotImplementedError
226233

227234
def get_downloadable_files(self, *args, **kwargs):
235+
"""Get downloadable files functionality is not implemented for Firefox driver."""
228236
raise NotImplementedError
229237

230238
def delete_downloadable_files(self, *args, **kwargs):
239+
"""Delete downloadable files functionality is not implemented for Firefox driver."""
231240
raise NotImplementedError

0 commit comments

Comments
 (0)