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

Function main

seleniumbase/console_scripts/sb_mkchart.py:58–269  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

56
57
58def main():
59 c1 = ""
60 c5 = ""
61 c7 = ""
62 cr = ""
63 if "linux" not in sys.platform:
64 c1 = colorama.Fore.BLUE + colorama.Back.LIGHTCYAN_EX
65 c5 = colorama.Fore.RED + colorama.Back.LIGHTYELLOW_EX
66 c7 = colorama.Fore.BLACK + colorama.Back.MAGENTA
67 cr = colorama.Style.RESET_ALL
68
69 help_me = False
70 error_msg = None
71 invalid_cmd = None
72 language = "English"
73
74 command_args = sys.argv[2:]
75 file_name = command_args[0]
76 if file_name == "-h" or file_name == "--help":
77 invalid_run_command("help")
78 elif not file_name.endswith(".py"):
79 error_msg = 'File name must end with ".py"!'
80 elif "*" in file_name or len(str(file_name)) < 4:
81 error_msg = "Invalid file name!"
82 elif file_name.startswith("-"):
83 error_msg = 'File name cannot start with "-"!'
84 elif "/" in str(file_name) or "\\" in str(file_name):
85 error_msg = "File must be created in the current directory!"
86 elif os.path.exists(os.getcwd() + "/" + file_name):
87 error_msg = 'File "%s" already exists in this directory!' % file_name
88 if error_msg:
89 error_msg = c5 + "ERROR: " + error_msg + cr
90 invalid_run_command(error_msg)
91
92 if len(command_args) >= 2:
93 options = command_args[1:]
94 for option in options:
95 option = option.lower()
96 if option == "-h" or option == "--help":
97 help_me = True
98 elif option == "--en" or option == "--english":
99 language = "English"
100 elif option == "--zh" or option == "--chinese":
101 language = "Chinese"
102 elif option == "--nl" or option == "--dutch":
103 language = "Dutch"
104 elif option == "--fr" or option == "--french":
105 language = "French"
106 elif option == "--it" or option == "--italian":
107 language = "Italian"
108 elif option == "--ja" or option == "--japanese":
109 language = "Japanese"
110 elif option == "--ko" or option == "--korean":
111 language = "Korean"
112 elif option == "--pt" or option == "--portuguese":
113 language = "Portuguese"
114 elif option == "--ru" or option == "--russian":
115 language = "Russian"

Callers

nothing calls this directly

Calls 4

get_import_lineMethod · 0.80
get_lang_parent_classMethod · 0.80
closeMethod · 0.80
invalid_run_commandFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…