jetpytools 2.2.2__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.2 → jetpytools-2.2.4}/PKG-INFO +1 -1
- jetpytools-2.2.4/jetpytools/_version.py +2 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/jetpytools/exceptions/base.py +5 -5
- {jetpytools-2.2.2 → jetpytools-2.2.4}/jetpytools/types/supports.py +6 -6
- jetpytools-2.2.2/jetpytools/_version.py +0 -2
- {jetpytools-2.2.2 → jetpytools-2.2.4}/.gitignore +0 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/LICENSE +0 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/README.md +0 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/jetpytools/__init__.py +0 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/jetpytools/enums/__init__.py +0 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/jetpytools/enums/base.py +0 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/jetpytools/enums/other.py +0 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/jetpytools/exceptions/__init__.py +0 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/jetpytools/exceptions/enum.py +0 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/jetpytools/exceptions/file.py +0 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/jetpytools/exceptions/generic.py +0 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/jetpytools/exceptions/module.py +0 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/jetpytools/functions/__init__.py +0 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/jetpytools/functions/funcs.py +0 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/jetpytools/functions/normalize.py +0 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/jetpytools/functions/other.py +0 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/jetpytools/py.typed +0 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/jetpytools/types/__init__.py +0 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/jetpytools/types/builtins.py +0 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/jetpytools/types/check.py +0 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/jetpytools/types/file.py +0 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/jetpytools/types/funcs.py +0 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/jetpytools/types/generic.py +0 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/jetpytools/types/utils.py +0 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/jetpytools/utils/__init__.py +0 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/jetpytools/utils/file.py +0 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/jetpytools/utils/funcs.py +0 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/jetpytools/utils/math.py +0 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/jetpytools/utils/ranges.py +0 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/pyproject.toml +0 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/tests/test_file.py +0 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/tests/test_funcs.py +0 -0
- {jetpytools-2.2.2 → jetpytools-2.2.4}/tests/test_normalize.py +0 -0
- {jetpytools-2.2.2 → 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:
|
|
@@ -52,22 +52,22 @@ class SupportsString(Protocol):
|
|
|
52
52
|
|
|
53
53
|
@runtime_checkable
|
|
54
54
|
class SupportsDunderLT[T_contra](Protocol):
|
|
55
|
-
def __lt__(self, other: T_contra) -> bool: ...
|
|
55
|
+
def __lt__(self, other: T_contra, /) -> bool: ...
|
|
56
56
|
|
|
57
57
|
|
|
58
58
|
@runtime_checkable
|
|
59
59
|
class SupportsDunderGT[T_contra](Protocol):
|
|
60
|
-
def __gt__(self, other: T_contra) -> bool: ...
|
|
60
|
+
def __gt__(self, other: T_contra, /) -> bool: ...
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
@runtime_checkable
|
|
64
64
|
class SupportsDunderLE[T_contra](Protocol):
|
|
65
|
-
def __le__(self, other: T_contra) -> bool: ...
|
|
65
|
+
def __le__(self, other: T_contra, /) -> bool: ...
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
@runtime_checkable
|
|
69
69
|
class SupportsDunderGE[T_contra](Protocol):
|
|
70
|
-
def __ge__(self, other: T_contra) -> bool: ...
|
|
70
|
+
def __ge__(self, other: T_contra, /) -> bool: ...
|
|
71
71
|
|
|
72
72
|
|
|
73
73
|
@runtime_checkable
|
|
@@ -115,14 +115,14 @@ class ComparatorFunc(Protocol):
|
|
|
115
115
|
|
|
116
116
|
@runtime_checkable
|
|
117
117
|
class SupportsIndexing[T](Protocol):
|
|
118
|
-
def __getitem__(self, k: int) -> T: ...
|
|
118
|
+
def __getitem__(self, k: int, /) -> T: ...
|
|
119
119
|
|
|
120
120
|
|
|
121
121
|
@runtime_checkable
|
|
122
122
|
class SupportsKeysAndGetItem[KT, VT](Protocol):
|
|
123
123
|
def keys(self) -> Iterable[KT]: ...
|
|
124
124
|
|
|
125
|
-
def __getitem__(self, k: KT) -> VT: ...
|
|
125
|
+
def __getitem__(self, k: KT, /) -> VT: ...
|
|
126
126
|
|
|
127
127
|
|
|
128
128
|
SupportsFloatOrIndex = SupportsFloat | SupportsIndex
|
|
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
|