(
file_name,
url,
overwrite_enabled,
brx,
ucb,
output_format,
window,
)
| 80 | |
| 81 | |
| 82 | def do_recording( |
| 83 | file_name, |
| 84 | url, |
| 85 | overwrite_enabled, |
| 86 | brx, |
| 87 | ucb, |
| 88 | output_format, |
| 89 | window, |
| 90 | ): |
| 91 | poll = None |
| 92 | if sb_config.rec_subprocess_used: |
| 93 | poll = sb_config.rec_subprocess_p.poll() |
| 94 | if not sb_config.rec_subprocess_used or poll is not None: |
| 95 | pass |
| 96 | else: |
| 97 | show_already_recording_warning() |
| 98 | send_window_to_front(window) |
| 99 | poll = sb_config.rec_subprocess_p.poll() |
| 100 | if poll is None: |
| 101 | return |
| 102 | |
| 103 | file_name = file_name.strip() |
| 104 | error_msg = file_name_error(file_name) |
| 105 | if error_msg: |
| 106 | messagebox.showwarning( |
| 107 | "Invalid filename", "Invalid filename: %s" % error_msg |
| 108 | ) |
| 109 | return |
| 110 | |
| 111 | url = url.strip() |
| 112 | if not page_utils.is_valid_url(url): |
| 113 | if page_utils.is_valid_url("https://" + url): |
| 114 | url = "https://" + url |
| 115 | if "edge" in brx.lower() and ucb: |
| 116 | messagebox.showwarning( |
| 117 | "Invalid selection", |
| 118 | "MS Edge cannot be combined with UC Mode " |
| 119 | "because it uses msedgedriver, not chromedriver!", |
| 120 | ) |
| 121 | elif not page_utils.is_valid_url(url): |
| 122 | messagebox.showwarning( |
| 123 | "Invalid URL", "Enter a valid URL! (Eg. seleniumbase.io)" |
| 124 | ) |
| 125 | else: |
| 126 | if os.path.exists(os.getcwd() + "/" + file_name): |
| 127 | if not overwrite_enabled: |
| 128 | msgbox = tk.messagebox.askquestion( |
| 129 | "Overwrite?", |
| 130 | 'Are you sure you want to overwrite "%s"?' % file_name, |
| 131 | icon="warning", |
| 132 | ) |
| 133 | if msgbox == "yes": |
| 134 | os.remove(file_name) |
| 135 | else: |
| 136 | tk.messagebox.showinfo("Cancelled", "Recording Cancelled!") |
| 137 | return |
| 138 | else: |
| 139 | os.remove(file_name) |
no test coverage detected
searching dependent graphs…