jetpytools 2.2.3__tar.gz → 2.2.5__tar.gz

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.
Files changed (39) hide show
  1. {jetpytools-2.2.3 → jetpytools-2.2.5}/PKG-INFO +1 -1
  2. jetpytools-2.2.5/jetpytools/_version.py +2 -0
  3. {jetpytools-2.2.3 → jetpytools-2.2.5}/jetpytools/exceptions/base.py +7 -5
  4. jetpytools-2.2.3/jetpytools/_version.py +0 -2
  5. {jetpytools-2.2.3 → jetpytools-2.2.5}/.gitignore +0 -0
  6. {jetpytools-2.2.3 → jetpytools-2.2.5}/LICENSE +0 -0
  7. {jetpytools-2.2.3 → jetpytools-2.2.5}/README.md +0 -0
  8. {jetpytools-2.2.3 → jetpytools-2.2.5}/jetpytools/__init__.py +0 -0
  9. {jetpytools-2.2.3 → jetpytools-2.2.5}/jetpytools/enums/__init__.py +0 -0
  10. {jetpytools-2.2.3 → jetpytools-2.2.5}/jetpytools/enums/base.py +0 -0
  11. {jetpytools-2.2.3 → jetpytools-2.2.5}/jetpytools/enums/other.py +0 -0
  12. {jetpytools-2.2.3 → jetpytools-2.2.5}/jetpytools/exceptions/__init__.py +0 -0
  13. {jetpytools-2.2.3 → jetpytools-2.2.5}/jetpytools/exceptions/enum.py +0 -0
  14. {jetpytools-2.2.3 → jetpytools-2.2.5}/jetpytools/exceptions/file.py +0 -0
  15. {jetpytools-2.2.3 → jetpytools-2.2.5}/jetpytools/exceptions/generic.py +0 -0
  16. {jetpytools-2.2.3 → jetpytools-2.2.5}/jetpytools/exceptions/module.py +0 -0
  17. {jetpytools-2.2.3 → jetpytools-2.2.5}/jetpytools/functions/__init__.py +0 -0
  18. {jetpytools-2.2.3 → jetpytools-2.2.5}/jetpytools/functions/funcs.py +0 -0
  19. {jetpytools-2.2.3 → jetpytools-2.2.5}/jetpytools/functions/normalize.py +0 -0
  20. {jetpytools-2.2.3 → jetpytools-2.2.5}/jetpytools/functions/other.py +0 -0
  21. {jetpytools-2.2.3 → jetpytools-2.2.5}/jetpytools/py.typed +0 -0
  22. {jetpytools-2.2.3 → jetpytools-2.2.5}/jetpytools/types/__init__.py +0 -0
  23. {jetpytools-2.2.3 → jetpytools-2.2.5}/jetpytools/types/builtins.py +0 -0
  24. {jetpytools-2.2.3 → jetpytools-2.2.5}/jetpytools/types/check.py +0 -0
  25. {jetpytools-2.2.3 → jetpytools-2.2.5}/jetpytools/types/file.py +0 -0
  26. {jetpytools-2.2.3 → jetpytools-2.2.5}/jetpytools/types/funcs.py +0 -0
  27. {jetpytools-2.2.3 → jetpytools-2.2.5}/jetpytools/types/generic.py +0 -0
  28. {jetpytools-2.2.3 → jetpytools-2.2.5}/jetpytools/types/supports.py +0 -0
  29. {jetpytools-2.2.3 → jetpytools-2.2.5}/jetpytools/types/utils.py +0 -0
  30. {jetpytools-2.2.3 → jetpytools-2.2.5}/jetpytools/utils/__init__.py +0 -0
  31. {jetpytools-2.2.3 → jetpytools-2.2.5}/jetpytools/utils/file.py +0 -0
  32. {jetpytools-2.2.3 → jetpytools-2.2.5}/jetpytools/utils/funcs.py +0 -0
  33. {jetpytools-2.2.3 → jetpytools-2.2.5}/jetpytools/utils/math.py +0 -0
  34. {jetpytools-2.2.3 → jetpytools-2.2.5}/jetpytools/utils/ranges.py +0 -0
  35. {jetpytools-2.2.3 → jetpytools-2.2.5}/pyproject.toml +0 -0
  36. {jetpytools-2.2.3 → jetpytools-2.2.5}/tests/test_file.py +0 -0
  37. {jetpytools-2.2.3 → jetpytools-2.2.5}/tests/test_funcs.py +0 -0
  38. {jetpytools-2.2.3 → jetpytools-2.2.5}/tests/test_normalize.py +0 -0
  39. {jetpytools-2.2.3 → jetpytools-2.2.5}/tests/test_types_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jetpytools
3
- Version: 2.2.3
3
+ Version: 2.2.5
4
4
  Summary: Collection of stuff that's useful in general python programming
5
5
  Project-URL: Source Code, https://github.com/Jaded-Encoding-Thaumaturgy/jetpytools
6
6
  Project-URL: Contact, https://discord.gg/XTpc6Fa9eB
@@ -0,0 +1,2 @@
1
+ __version__ = "2.2.5"
2
+ __version_tuple__ = (2, 2, 5)
@@ -1,5 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import os
3
4
  import sys
4
5
  from contextlib import AbstractContextManager
5
6
  from types import TracebackType
@@ -31,9 +32,6 @@ class CustomErrorMeta(type):
31
32
  if cls.__qualname__.startswith("Custom"):
32
33
  cls.__qualname__ = cls.__qualname__[6:]
33
34
 
34
- if sys.stdout and sys.stdout.isatty():
35
- cls.__qualname__ = f"\033[0;31;1m{cls.__qualname__}\033[0m"
36
-
37
35
  cls.__module__ = Exception.__module__
38
36
 
39
37
  return cls
@@ -101,10 +99,14 @@ class CustomError(Exception, metaclass=CustomErrorMeta):
101
99
  if not message:
102
100
  message = "An error occurred!"
103
101
 
102
+ should_color = (
103
+ sys.stdout and sys.stdout.isatty() and not os.getenv("NO_COLOR") and not os.getenv("JETPYTOOLS_NO_COLOR")
104
+ )
105
+
104
106
  if self.func:
105
107
  func_header = norm_func_name(self.func).strip()
106
108
 
107
- if sys.stdout and sys.stdout.isatty():
109
+ if should_color:
108
110
  func_header = f"\033[0;36m{func_header}\033[0m"
109
111
 
110
112
  func_header = f"({func_header}) "
@@ -121,7 +123,7 @@ class CustomError(Exception, metaclass=CustomErrorMeta):
121
123
  if not isinstance(self.reason, dict):
122
124
  reason = f"({reason})"
123
125
 
124
- if sys.stdout and sys.stdout.isatty():
126
+ if should_color:
125
127
  reason = f"\033[0;33m{reason}\033[0m"
126
128
  reason = f" {reason}"
127
129
  else:
@@ -1,2 +0,0 @@
1
- __version__ = "2.2.3"
2
- __version_tuple__ = (2, 2, 3)
File without changes
File without changes
File without changes
File without changes