seleniumbase 4.31.4__py3-none-any.whl → 4.31.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
seleniumbase/__init__.py CHANGED
@@ -1,21 +1,18 @@
1
1
  import collections
2
2
  import os
3
3
  import pdb
4
- try:
5
- import pdbp # (Pdb+) --- Python Debugger Plus
6
- except Exception:
7
- pass
8
4
  import sys
5
+ from contextlib import suppress
9
6
  from selenium import webdriver
10
7
  from seleniumbase.__version__ import __version__
11
8
  from seleniumbase.common import decorators # noqa
12
9
  from seleniumbase.common import encryption # noqa
13
- from seleniumbase.core import colored_traceback # noqa
10
+ from seleniumbase.core import colored_traceback
14
11
  from seleniumbase.core.browser_launcher import get_driver # noqa
15
12
  from seleniumbase.fixtures import js_utils # noqa
16
13
  from seleniumbase.fixtures import page_actions # noqa
17
14
  from seleniumbase.fixtures import page_utils # noqa
18
- from seleniumbase.fixtures import shared_utils # noqa
15
+ from seleniumbase.fixtures import shared_utils
19
16
  from seleniumbase.fixtures.base_case import BaseCase # noqa
20
17
  from seleniumbase.masterqa.master_qa import MasterQA # noqa
21
18
  from seleniumbase.plugins.sb_manager import SB # noqa
@@ -23,6 +20,17 @@ from seleniumbase.plugins.driver_manager import Driver # noqa
23
20
  from seleniumbase.plugins.driver_manager import DriverContext # noqa
24
21
  from seleniumbase import translate # noqa
25
22
 
23
+ with suppress(Exception):
24
+ import colorama
25
+ import pdbp # (Pdb+) --- Python Debugger Plus
26
+
27
+ is_windows = shared_utils.is_windows()
28
+ with suppress(Exception):
29
+ if is_windows and hasattr(colorama, "just_fix_windows_console"):
30
+ colorama.just_fix_windows_console()
31
+ elif not shared_utils.is_linux():
32
+ colorama.init(autoreset=True)
33
+
26
34
  if sys.version_info[0] < 3 and "pdbp" in locals():
27
35
  # With Python3, "import pdbp" is all you need
28
36
  for key in pdbp.__dict__.keys():
@@ -1,2 +1,2 @@
1
1
  # seleniumbase package
2
- __version__ = "4.31.4"
2
+ __version__ = "4.31.5"
@@ -1231,10 +1231,6 @@ def behave_dashboard_prepare():
1231
1231
  c1 = ""
1232
1232
  cr = ""
1233
1233
  if not is_linux:
1234
- if is_windows and hasattr(colorama, "just_fix_windows_console"):
1235
- colorama.just_fix_windows_console()
1236
- else:
1237
- colorama.init(autoreset=True)
1238
1234
  c1 = colorama.Fore.BLUE + colorama.Back.LIGHTCYAN_EX
1239
1235
  cr = colorama.Style.RESET_ALL
1240
1236
  print("Dashboard: %s%s%s\n%s" % (c1, dash_path, cr, stars))
@@ -1346,10 +1342,6 @@ def _perform_behave_terminal_summary_():
1346
1342
  c2 = ""
1347
1343
  cr = ""
1348
1344
  if not is_linux:
1349
- if is_windows and hasattr(colorama, "just_fix_windows_console"):
1350
- colorama.just_fix_windows_console()
1351
- else:
1352
- colorama.init(autoreset=True)
1353
1345
  c2 = colorama.Fore.MAGENTA + colorama.Back.LIGHTYELLOW_EX
1354
1346
  cr = colorama.Style.RESET_ALL
1355
1347
  if sb_config.dashboard:
@@ -4,7 +4,6 @@
4
4
 
5
5
  import colorama
6
6
  import os
7
- import sys
8
7
  from contextlib import suppress
9
8
 
10
9
  r"""
@@ -17,13 +16,6 @@ r"""
17
16
 
18
17
 
19
18
  def get_seleniumbase_logo():
20
- if (
21
- "win32" in sys.platform
22
- and hasattr(colorama, "just_fix_windows_console")
23
- ):
24
- colorama.just_fix_windows_console()
25
- else:
26
- colorama.init(autoreset=True)
27
19
  c1 = colorama.Fore.BLUE + colorama.Back.LIGHTCYAN_EX
28
20
  c2 = colorama.Fore.BLUE + colorama.Back.LIGHTGREEN_EX
29
21
  c3 = colorama.Back.CYAN