(
image, image_filename, image_height, image_width, caller
)
| 225 | |
| 226 | |
| 227 | def build_save_image_post_script( |
| 228 | image, image_filename, image_height, image_width, caller |
| 229 | ): |
| 230 | if image: |
| 231 | if image not in __IMAGE_FORMATS: |
| 232 | raise ValueError( |
| 233 | "The image parameter must be one of the following: {}".format( |
| 234 | __IMAGE_FORMATS |
| 235 | ) |
| 236 | ) |
| 237 | |
| 238 | script = get_image_download_script(caller) |
| 239 | post_script = script.format( |
| 240 | format=image, |
| 241 | width=image_width, |
| 242 | height=image_height, |
| 243 | filename=image_filename, |
| 244 | ) |
| 245 | else: |
| 246 | post_script = None |
| 247 | |
| 248 | return post_script |
| 249 | |
| 250 | |
| 251 | def init_notebook_mode(connected=False): |
no test coverage detected