jetpytools 2.2.3__tar.gz → 2.2.4__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.
- {jetpytools-2.2.3 → jetpytools-2.2.4}/PKG-INFO +1 -1
- jetpytools-2.2.4/jetpytools/_version.py +2 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/jetpytools/exceptions/base.py +5 -5
- jetpytools-2.2.3/jetpytools/_version.py +0 -2
- {jetpytools-2.2.3 → jetpytools-2.2.4}/.gitignore +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/LICENSE +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/README.md +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/jetpytools/__init__.py +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/jetpytools/enums/__init__.py +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/jetpytools/enums/base.py +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/jetpytools/enums/other.py +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/jetpytools/exceptions/__init__.py +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/jetpytools/exceptions/enum.py +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/jetpytools/exceptions/file.py +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/jetpytools/exceptions/generic.py +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/jetpytools/exceptions/module.py +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/jetpytools/functions/__init__.py +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/jetpytools/functions/funcs.py +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/jetpytools/functions/normalize.py +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/jetpytools/functions/other.py +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/jetpytools/py.typed +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/jetpytools/types/__init__.py +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/jetpytools/types/builtins.py +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/jetpytools/types/check.py +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/jetpytools/types/file.py +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/jetpytools/types/funcs.py +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/jetpytools/types/generic.py +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/jetpytools/types/supports.py +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/jetpytools/types/utils.py +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/jetpytools/utils/__init__.py +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/jetpytools/utils/file.py +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/jetpytools/utils/funcs.py +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/jetpytools/utils/math.py +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/jetpytools/utils/ranges.py +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/pyproject.toml +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/tests/test_file.py +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/tests/test_funcs.py +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/tests/test_normalize.py +0 -0
- {jetpytools-2.2.3 → jetpytools-2.2.4}/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
|
+
Version: 2.2.4
|
|
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
|
|
@@ -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,12 @@ class CustomError(Exception, metaclass=CustomErrorMeta):
|
|
|
101
99
|
if not message:
|
|
102
100
|
message = "An error occurred!"
|
|
103
101
|
|
|
102
|
+
should_color = sys.stdout and sys.stdout.isatty() and not os.getenv("NO_COLOR")
|
|
103
|
+
|
|
104
104
|
if self.func:
|
|
105
105
|
func_header = norm_func_name(self.func).strip()
|
|
106
106
|
|
|
107
|
-
if
|
|
107
|
+
if should_color:
|
|
108
108
|
func_header = f"\033[0;36m{func_header}\033[0m"
|
|
109
109
|
|
|
110
110
|
func_header = f"({func_header}) "
|
|
@@ -121,7 +121,7 @@ class CustomError(Exception, metaclass=CustomErrorMeta):
|
|
|
121
121
|
if not isinstance(self.reason, dict):
|
|
122
122
|
reason = f"({reason})"
|
|
123
123
|
|
|
124
|
-
if
|
|
124
|
+
if should_color:
|
|
125
125
|
reason = f"\033[0;33m{reason}\033[0m"
|
|
126
126
|
reason = f" {reason}"
|
|
127
127
|
else:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|