31
31
def show_usage ():
32
32
show_basic_usage ()
33
33
sc = ("" )
34
- sc += ('Type "sbase help [COMMAND]" for specific command info.\n ' )
35
- sc += ('For info on all commands, type: "seleniumbase --help".\n ' )
36
- sc += ('* (Use "pytest" for running tests) *\n ' )
37
- c1 = colorama .Fore .BLUE + colorama .Back .LIGHTCYAN_EX
38
- c2 = colorama .Fore .BLUE + colorama .Back .LIGHTGREEN_EX
39
- c3 = colorama .Fore .BLUE + colorama .Back .LIGHTYELLOW_EX
40
- c4 = colorama .Fore .MAGENTA + colorama .Back .LIGHTYELLOW_EX
41
- cr = colorama .Style .RESET_ALL
42
- sc = sc .replace ("seleniumbase" , c1 + "selenium" + c2 + "base" + cr )
43
- sc = sc .replace ("sbase" , c1 + "s" + c2 + "base" + cr )
44
- sc = sc .replace ("pytest" , c3 + "pytest" + cr )
45
- sc = sc .replace ("--help" , c4 + "--help" + cr )
46
- sc = sc .replace ("help" , c4 + "help" + cr )
34
+ sc += (' Type "sbase help [COMMAND]" for specific command info.\n ' )
35
+ sc += (' For info on all commands, type: "seleniumbase --help".\n ' )
36
+ sc += (' * (Use "pytest" for running tests) *\n ' )
37
+ if "linux" not in sys .platform :
38
+ colorama .init (autoreset = True )
39
+ c1 = colorama .Fore .BLUE + colorama .Back .LIGHTCYAN_EX
40
+ c2 = colorama .Fore .BLUE + colorama .Back .LIGHTGREEN_EX
41
+ c3 = colorama .Fore .BLUE + colorama .Back .LIGHTYELLOW_EX
42
+ c4 = colorama .Fore .MAGENTA + colorama .Back .LIGHTYELLOW_EX
43
+ cr = colorama .Style .RESET_ALL
44
+ sc = sc .replace ("seleniumbase" , c1 + "selenium" + c2 + "base" + cr )
45
+ sc = sc .replace ("sbase" , c1 + "s" + c2 + "base" + cr )
46
+ sc = sc .replace ("pytest" , c3 + "pytest" + cr )
47
+ sc = sc .replace ("--help" , c4 + "--help" + cr )
48
+ sc = sc .replace ("help" , c4 + "help" + cr )
47
49
print (sc )
48
50
49
51
50
52
def show_basic_usage ():
51
53
from seleniumbase .console_scripts import logo_helper
52
54
seleniumbase_logo = logo_helper .get_seleniumbase_logo ()
55
+ colorama .init (autoreset = True )
53
56
print (seleniumbase_logo )
54
57
print ("%s" % get_version ()[0 :1 ])
55
58
print ("" )
56
59
sc = ("" )
57
- sc += ('Usage : "seleniumbase [COMMAND] [PARAMETERS]"\n ' )
58
- sc += ('(simplified): "sbase [COMMAND] [PARAMETERS]"\n ' )
60
+ sc += (' * USAGE : "seleniumbase [COMMAND] [PARAMETERS]"\n ' )
61
+ sc += (' * OR: "sbase [COMMAND] [PARAMETERS]"\n ' )
59
62
sc += ("\n " )
60
- sc += ("Commands :\n " )
63
+ sc += ("COMMANDS :\n " )
61
64
sc += (" install [DRIVER_NAME] [OPTIONS]\n " )
62
65
sc += (" mkdir [DIRECTORY_NAME]\n " )
63
66
sc += (" mkfile [FILE_NAME.py]\n " )
@@ -74,17 +77,20 @@ def show_basic_usage():
74
77
sc += (" download server (Selenium Server JAR file)\n " )
75
78
sc += (" grid-hub [start|stop] [OPTIONS]\n " )
76
79
sc += (" grid-node [start|stop] --hub=[HUB_IP] [OPTIONS]\n " )
77
- sc += (' * (EXAMPLE: "sbase install chromedriver latest") *\n ' )
80
+ sc += (' * (EXAMPLE: "sbase install chromedriver latest") *\n ' )
78
81
sc += ("" )
79
- c1 = colorama .Fore .BLUE + colorama .Back .LIGHTCYAN_EX
80
- c2 = colorama .Fore .BLUE + colorama .Back .LIGHTGREEN_EX
81
- cr = colorama .Style .RESET_ALL
82
- sc = sc .replace ("seleniumbase" , c1 + "selenium" + c2 + "base" + cr )
83
- sc = sc .replace ("sbase" , c1 + "s" + c2 + "base" + cr )
82
+ if "linux" not in sys .platform :
83
+ colorama .init (autoreset = True )
84
+ c1 = colorama .Fore .BLUE + colorama .Back .LIGHTCYAN_EX
85
+ c2 = colorama .Fore .BLUE + colorama .Back .LIGHTGREEN_EX
86
+ cr = colorama .Style .RESET_ALL
87
+ sc = sc .replace ("seleniumbase" , c1 + "selenium" + c2 + "base" + cr )
88
+ sc = sc .replace ("sbase" , c1 + "s" + c2 + "base" + cr )
84
89
print (sc )
85
90
86
91
87
92
def show_install_usage ():
93
+ colorama .init (autoreset = True )
88
94
c2 = colorama .Fore .BLUE + colorama .Back .LIGHTGREEN_EX
89
95
c3 = colorama .Fore .BLUE + colorama .Back .LIGHTYELLOW_EX
90
96
cr = colorama .Style .RESET_ALL
@@ -119,6 +125,7 @@ def show_install_usage():
119
125
120
126
121
127
def show_mkdir_usage ():
128
+ colorama .init (autoreset = True )
122
129
c2 = colorama .Fore .BLUE + colorama .Back .LIGHTGREEN_EX
123
130
c3 = colorama .Fore .BLUE + colorama .Back .LIGHTYELLOW_EX
124
131
cr = colorama .Style .RESET_ALL
@@ -140,6 +147,7 @@ def show_mkdir_usage():
140
147
141
148
142
149
def show_mkfile_usage ():
150
+ colorama .init (autoreset = True )
143
151
c2 = colorama .Fore .BLUE + colorama .Back .LIGHTGREEN_EX
144
152
c3 = colorama .Fore .BLUE + colorama .Back .LIGHTYELLOW_EX
145
153
cr = colorama .Style .RESET_ALL
@@ -172,6 +180,7 @@ def show_mkfile_usage():
172
180
173
181
174
182
def show_convert_usage ():
183
+ colorama .init (autoreset = True )
175
184
c2 = colorama .Fore .BLUE + colorama .Back .LIGHTGREEN_EX
176
185
c3 = colorama .Fore .BLUE + colorama .Back .LIGHTYELLOW_EX
177
186
cr = colorama .Style .RESET_ALL
@@ -191,6 +200,7 @@ def show_convert_usage():
191
200
192
201
193
202
def show_print_usage ():
203
+ colorama .init (autoreset = True )
194
204
c2 = colorama .Fore .BLUE + colorama .Back .LIGHTGREEN_EX
195
205
c3 = colorama .Fore .BLUE + colorama .Back .LIGHTYELLOW_EX
196
206
cr = colorama .Style .RESET_ALL
@@ -209,6 +219,7 @@ def show_print_usage():
209
219
210
220
211
221
def show_translate_usage ():
222
+ colorama .init (autoreset = True )
212
223
c2 = colorama .Fore .BLUE + colorama .Back .LIGHTGREEN_EX
213
224
c3 = colorama .Fore .BLUE + colorama .Back .LIGHTYELLOW_EX
214
225
cr = colorama .Style .RESET_ALL
@@ -244,6 +255,7 @@ def show_translate_usage():
244
255
245
256
246
257
def show_extract_objects_usage ():
258
+ colorama .init (autoreset = True )
247
259
c2 = colorama .Fore .BLUE + colorama .Back .LIGHTGREEN_EX
248
260
c3 = colorama .Fore .BLUE + colorama .Back .LIGHTYELLOW_EX
249
261
cr = colorama .Style .RESET_ALL
@@ -261,6 +273,7 @@ def show_extract_objects_usage():
261
273
262
274
263
275
def show_inject_objects_usage ():
276
+ colorama .init (autoreset = True )
264
277
c2 = colorama .Fore .BLUE + colorama .Back .LIGHTGREEN_EX
265
278
c3 = colorama .Fore .BLUE + colorama .Back .LIGHTYELLOW_EX
266
279
cr = colorama .Style .RESET_ALL
@@ -281,6 +294,7 @@ def show_inject_objects_usage():
281
294
282
295
283
296
def show_objectify_usage ():
297
+ colorama .init (autoreset = True )
284
298
c2 = colorama .Fore .BLUE + colorama .Back .LIGHTGREEN_EX
285
299
c3 = colorama .Fore .BLUE + colorama .Back .LIGHTYELLOW_EX
286
300
cr = colorama .Style .RESET_ALL
@@ -304,6 +318,7 @@ def show_objectify_usage():
304
318
305
319
306
320
def show_revert_objects_usage ():
321
+ colorama .init (autoreset = True )
307
322
c2 = colorama .Fore .BLUE + colorama .Back .LIGHTGREEN_EX
308
323
c3 = colorama .Fore .BLUE + colorama .Back .LIGHTYELLOW_EX
309
324
cr = colorama .Style .RESET_ALL
@@ -325,6 +340,7 @@ def show_revert_objects_usage():
325
340
326
341
327
342
def show_encrypt_usage ():
343
+ colorama .init (autoreset = True )
328
344
c2 = colorama .Fore .BLUE + colorama .Back .LIGHTGREEN_EX
329
345
c3 = colorama .Fore .BLUE + colorama .Back .LIGHTYELLOW_EX
330
346
cr = colorama .Style .RESET_ALL
@@ -342,6 +358,7 @@ def show_encrypt_usage():
342
358
343
359
344
360
def show_decrypt_usage ():
361
+ colorama .init (autoreset = True )
345
362
c2 = colorama .Fore .BLUE + colorama .Back .LIGHTGREEN_EX
346
363
c3 = colorama .Fore .BLUE + colorama .Back .LIGHTYELLOW_EX
347
364
cr = colorama .Style .RESET_ALL
@@ -359,6 +376,7 @@ def show_decrypt_usage():
359
376
360
377
361
378
def show_download_usage ():
379
+ colorama .init (autoreset = True )
362
380
c2 = colorama .Fore .BLUE + colorama .Back .LIGHTGREEN_EX
363
381
c3 = colorama .Fore .BLUE + colorama .Back .LIGHTYELLOW_EX
364
382
cr = colorama .Style .RESET_ALL
@@ -375,6 +393,7 @@ def show_download_usage():
375
393
376
394
377
395
def show_grid_hub_usage ():
396
+ colorama .init (autoreset = True )
378
397
c2 = colorama .Fore .BLUE + colorama .Back .LIGHTGREEN_EX
379
398
c3 = colorama .Fore .BLUE + colorama .Back .LIGHTYELLOW_EX
380
399
cr = colorama .Style .RESET_ALL
@@ -402,6 +421,7 @@ def show_grid_hub_usage():
402
421
403
422
404
423
def show_grid_node_usage ():
424
+ colorama .init (autoreset = True )
405
425
c2 = colorama .Fore .BLUE + colorama .Back .LIGHTGREEN_EX
406
426
c3 = colorama .Fore .BLUE + colorama .Back .LIGHTYELLOW_EX
407
427
cr = colorama .Style .RESET_ALL
@@ -441,6 +461,7 @@ def show_version_info():
441
461
442
462
443
463
def show_options ():
464
+ colorama .init (autoreset = True )
444
465
c1 = colorama .Fore .BLUE + colorama .Back .LIGHTCYAN_EX
445
466
c2 = colorama .Fore .BLUE + colorama .Back .LIGHTGREEN_EX
446
467
c3 = colorama .Fore .BLUE + colorama .Back .LIGHTYELLOW_EX
@@ -497,6 +518,7 @@ def show_options():
497
518
498
519
499
520
def show_detailed_help ():
521
+ colorama .init (autoreset = True )
500
522
c2 = colorama .Fore .BLUE + colorama .Back .LIGHTGREEN_EX
501
523
c3 = colorama .Fore .BLUE + colorama .Back .LIGHTYELLOW_EX
502
524
c6 = colorama .Back .CYAN
0 commit comments