MCPcopy Create free account
hub / github.com/seleniumbase/SeleniumBase / main

Function main

seleniumbase/translate/translator.py:268–1053  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

266
267
268def main():
269 c1 = colorama.Fore.BLUE + colorama.Back.LIGHTCYAN_EX
270 c2 = colorama.Fore.BLUE + colorama.Back.LIGHTYELLOW_EX
271 c3 = colorama.Fore.RED + colorama.Back.LIGHTGREEN_EX
272 c4 = colorama.Fore.BLUE + colorama.Back.LIGHTGREEN_EX
273 c5 = colorama.Fore.RED + colorama.Back.LIGHTYELLOW_EX
274 c6 = colorama.Fore.RED + colorama.Back.LIGHTCYAN_EX
275 c7 = colorama.Fore.BLACK + colorama.Back.MAGENTA
276 cr = colorama.Style.RESET_ALL
277 new_lang = None
278 overwrite = False
279 copy = False
280 print_only = False
281 help_me = False
282 invalid_cmd = None
283 line_numbers = False
284 word_wrap = True # Always use word wrap now
285
286 expected_arg = "A SeleniumBase Python file"
287 command_args = sys.argv[2:]
288 seleniumbase_file = command_args[0]
289 if not seleniumbase_file.endswith(".py"):
290 seleniumbase_file = (
291 c7 + ">>" + c5 + " " + seleniumbase_file + " " + c7 + "<<" + cr
292 )
293 bad_file_error = (
294 "\n`%s` is not a Python file!\n\n"
295 "Expecting: [%s]" % (seleniumbase_file, expected_arg)
296 )
297 bad_file_error = bad_file_error.replace(
298 "is not a Python file!", c3 + "is not a Python file!" + cr
299 )
300 bad_file_error = bad_file_error.replace(
301 expected_arg, c4 + expected_arg + cr
302 )
303 bad_file_error = bad_file_error.replace(
304 "Expecting:", c3 + "Expecting:" + cr
305 )
306 print(bad_file_error)
307 help_me = True
308
309 if len(command_args) >= 2 and not help_me:
310 options = command_args[1:]
311 for option in options:
312 option = option.lower()
313 if option == "help" or option == "--help":
314 help_me = True
315 elif option == "-o" or option == "--overwrite":
316 overwrite = True
317 elif option == "-c" or option == "--copy":
318 copy = True
319 elif option == "-p" or option == "--print":
320 print_only = True
321 elif option == "-n":
322 line_numbers = True
323 elif option == "--en" or option == "--english":
324 new_lang = "English"
325 elif option == "--zh" or option == "--chinese":

Callers

nothing calls this directly

Calls 6

findMethod · 0.80
get_locale_listMethod · 0.80
closeMethod · 0.80
process_test_fileFunction · 0.70
get_widthFunction · 0.70
get_locale_codeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…