Skip to content

Commit a4b9981

Browse files
committed
Fix colors
1 parent 383d1c9 commit a4b9981

File tree

1 file changed

+19
-17
lines changed
  • seleniumbase/console_scripts

1 file changed

+19
-17
lines changed

seleniumbase/console_scripts/run.py

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,18 @@ def show_usage():
3434
sc += ('Type "sbase help [COMMAND]" for specific command info.\n')
3535
sc += ('For info on all commands, type: "seleniumbase --help".\n')
3636
sc += ('* (Use "pytest" for running tests) *\n')
37-
colorama.init(autoreset=True)
38-
c1 = colorama.Fore.BLUE + colorama.Back.LIGHTCYAN_EX
39-
c2 = colorama.Fore.BLUE + colorama.Back.LIGHTGREEN_EX
40-
c3 = colorama.Fore.BLUE + colorama.Back.LIGHTYELLOW_EX
41-
c4 = colorama.Fore.MAGENTA + colorama.Back.LIGHTYELLOW_EX
42-
cr = colorama.Style.RESET_ALL
43-
sc = sc.replace("seleniumbase", c1 + "selenium" + c2 + "base" + cr)
44-
sc = sc.replace("sbase", c1 + "s" + c2 + "base" + cr)
45-
sc = sc.replace("pytest", c3 + "pytest" + cr)
46-
sc = sc.replace("--help", c4 + "--help" + cr)
47-
sc = sc.replace("help", c4 + "help" + cr)
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)
4849
print(sc)
4950

5051

@@ -78,12 +79,13 @@ def show_basic_usage():
7879
sc += (" grid-node [start|stop] --hub=[HUB_IP] [OPTIONS]\n")
7980
sc += (' * (EXAMPLE: "sbase install chromedriver latest") *\n')
8081
sc += ("")
81-
colorama.init(autoreset=True)
82-
c1 = colorama.Fore.BLUE + colorama.Back.LIGHTCYAN_EX
83-
c2 = colorama.Fore.BLUE + colorama.Back.LIGHTGREEN_EX
84-
cr = colorama.Style.RESET_ALL
85-
sc = sc.replace("seleniumbase", c1 + "selenium" + c2 + "base" + cr)
86-
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)
8789
print(sc)
8890

8991

0 commit comments

Comments
 (0)