funboost 44.8__py3-none-any.whl → 44.9__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.
Potentially problematic release.
This version of funboost might be problematic. Click here for more details.
- funboost/__init__.py +1 -1
- funboost/constant.py +14 -4
- funboost/consumers/base_consumer.py +48 -20
- funboost/core/booster.py +15 -0
- funboost/core/current_task.py +87 -68
- funboost/core/func_params_model.py +8 -0
- funboost/function_result_web/__pycache__/functions.cpython-39.pyc +0 -0
- funboost/publishers/base_publisher.py +21 -2
- funboost/set_frame_config.py +2 -1
- funboost/utils/class_utils.py +101 -51
- funboost/utils/dependency_packages_in_pythonpath/__pycache__/__init__.cpython-39.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/__pycache__/add_to_pythonpath.cpython-39.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__init__.py +59 -59
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/__init__.cpython-39.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/client.cpython-39.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/compat.cpython-39.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/connection.cpython-39.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/exceptions.cpython-39.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/lock.cpython-39.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/utils.cpython-39.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/client.py +4804 -4804
- funboost/utils/dependency_packages_in_pythonpath/aioredis/compat.py +8 -8
- funboost/utils/dependency_packages_in_pythonpath/aioredis/connection.py +1668 -1668
- funboost/utils/dependency_packages_in_pythonpath/aioredis/exceptions.py +96 -96
- funboost/utils/dependency_packages_in_pythonpath/aioredis/lock.py +306 -306
- funboost/utils/dependency_packages_in_pythonpath/aioredis/log.py +15 -15
- funboost/utils/dependency_packages_in_pythonpath/aioredis/sentinel.py +329 -329
- funboost/utils/dependency_packages_in_pythonpath/aioredis/utils.py +61 -61
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/StoppableThread.py +134 -133
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/__init__.py +16 -16
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/StoppableThread.cpython-39.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/__init__.cpython-39.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/dafunc.cpython-39.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/exceptions.cpython-39.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/py3_raise.cpython-39.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/dafunc.py +244 -244
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/dafunc2222.py +244 -0
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/exceptions.py +98 -98
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/py2_raise.py +7 -7
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/py3_raise.py +7 -7
- funboost/utils/times/__init__.py +85 -85
- funboost/utils/times/version.py +1 -1
- {funboost-44.8.dist-info → funboost-44.9.dist-info}/METADATA +1 -2
- {funboost-44.8.dist-info → funboost-44.9.dist-info}/RECORD +48 -76
- {funboost-44.8.dist-info → funboost-44.9.dist-info}/entry_points.txt +0 -1
- funboost/function_result_web/__pycache__/app.cpython-37.pyc +0 -0
- funboost/function_result_web/__pycache__/functions.cpython-37.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/__pycache__/__init__.cpython-311.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/__pycache__/__init__.cpython-37.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/__pycache__/add_to_pythonpath.cpython-311.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/__pycache__/add_to_pythonpath.cpython-37.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/__init__.cpython-311.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/__init__.cpython-37.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/client.cpython-311.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/client.cpython-37.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/compat.cpython-311.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/compat.cpython-37.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/connection.cpython-311.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/connection.cpython-37.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/exceptions.cpython-311.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/exceptions.cpython-37.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/lock.cpython-311.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/lock.cpython-37.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/utils.cpython-311.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/utils.cpython-37.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/StoppableThread.cpython-311.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/StoppableThread.cpython-37.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/__init__.cpython-311.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/__init__.cpython-37.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/dafunc.cpython-311.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/dafunc.cpython-37.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/exceptions.cpython-311.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/exceptions.cpython-37.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/py3_raise.cpython-311.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/py3_raise.cpython-37.pyc +0 -0
- {funboost-44.8.dist-info → funboost-44.9.dist-info}/LICENSE +0 -0
- {funboost-44.8.dist-info → funboost-44.9.dist-info}/WHEEL +0 -0
- {funboost-44.8.dist-info → funboost-44.9.dist-info}/top_level.txt +0 -0
funboost/utils/class_utils.py
CHANGED
|
@@ -1,51 +1,101 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
#
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
#
|
|
33
|
-
#
|
|
34
|
-
#
|
|
35
|
-
#
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
#
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
1
|
+
import copy
|
|
2
|
+
import gc
|
|
3
|
+
import inspect
|
|
4
|
+
import re
|
|
5
|
+
import sys
|
|
6
|
+
import typing
|
|
7
|
+
|
|
8
|
+
import nb_log
|
|
9
|
+
from types import MethodType, FunctionType
|
|
10
|
+
|
|
11
|
+
from funboost.constant import FunctionKind
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class ClsHelper:
|
|
15
|
+
@staticmethod
|
|
16
|
+
def get_instncae_method_cls(instncae_method):
|
|
17
|
+
print(instncae_method)
|
|
18
|
+
print(instncae_method.__qualname__)
|
|
19
|
+
print(instncae_method.__module__)
|
|
20
|
+
return getattr(sys.modules[instncae_method.__module__],instncae_method.__qualname__.split('.')[0])
|
|
21
|
+
# return instncae_method.__self__.__class__
|
|
22
|
+
|
|
23
|
+
@staticmethod
|
|
24
|
+
def get_classs_method_cls(class_method):
|
|
25
|
+
print(class_method)
|
|
26
|
+
print(class_method.__qualname__)
|
|
27
|
+
print(class_method.__module__)
|
|
28
|
+
return getattr(sys.modules[class_method.__module__],class_method.__qualname__.split('.')[0])
|
|
29
|
+
|
|
30
|
+
@staticmethod
|
|
31
|
+
def is_class_method(method):
|
|
32
|
+
# if inspect.ismethod(method):
|
|
33
|
+
# if hasattr(method, '__self__') and inspect.isclass(method.__self__):
|
|
34
|
+
# return True
|
|
35
|
+
# return False
|
|
36
|
+
|
|
37
|
+
sourcelines = inspect.getsourcelines(method)
|
|
38
|
+
# print(sourcelines)
|
|
39
|
+
line0: str = sourcelines[0][0]
|
|
40
|
+
if line0.replace(' ', '').startswith('@classmethod'):
|
|
41
|
+
return True
|
|
42
|
+
|
|
43
|
+
@staticmethod
|
|
44
|
+
def is_static_method(method):
|
|
45
|
+
sourcelines = inspect.getsourcelines(method)
|
|
46
|
+
line0: str = sourcelines[0][0]
|
|
47
|
+
if line0.replace(' ', '').startswith('@staticmethod'):
|
|
48
|
+
return True
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def is_instance_method(cls, method):
|
|
52
|
+
if cls.is_class_method(method):
|
|
53
|
+
return False
|
|
54
|
+
if cls.is_static_method(method):
|
|
55
|
+
return False
|
|
56
|
+
if isinstance(method, FunctionType):
|
|
57
|
+
sourcelines = inspect.getsourcelines(method)
|
|
58
|
+
for line in sourcelines[0][:50]:
|
|
59
|
+
if not line.replace( ' ','').startswith('#'):
|
|
60
|
+
if not line.startswith('def') and re.search('\(\s*?self\s*?,',line):
|
|
61
|
+
return True
|
|
62
|
+
# method_class = getattr(method, '__qualname__', '').rsplit('.', 1)[0]
|
|
63
|
+
# if method_class: # 如果能找到类名,说明是类的成员
|
|
64
|
+
# print( f"{method.__name__} 属于类 {method_class} 的成员")
|
|
65
|
+
#
|
|
66
|
+
# return True
|
|
67
|
+
|
|
68
|
+
@classmethod
|
|
69
|
+
def is_common_function(cls, method):
|
|
70
|
+
if cls.is_static_method(method):
|
|
71
|
+
return False
|
|
72
|
+
if cls.is_class_method(method):
|
|
73
|
+
return False
|
|
74
|
+
if cls.is_instance_method(method):
|
|
75
|
+
return False
|
|
76
|
+
if isinstance(method, FunctionType):
|
|
77
|
+
sourcelines = inspect.getsourcelines(method)
|
|
78
|
+
for line in sourcelines[0][:50]:
|
|
79
|
+
if not line.replace(' ', '').startswith('#'):
|
|
80
|
+
if not re.search('\(\s*?self\s*?,', line):
|
|
81
|
+
return True
|
|
82
|
+
|
|
83
|
+
@classmethod
|
|
84
|
+
def get_method_kind(cls, method: typing.Callable) -> str:
|
|
85
|
+
if cls.is_class_method(method):
|
|
86
|
+
return FunctionKind.CLASS_METHOD
|
|
87
|
+
elif cls.is_static_method(method):
|
|
88
|
+
return FunctionKind.STATIC_METHOD
|
|
89
|
+
elif cls.is_instance_method(method):
|
|
90
|
+
return FunctionKind.INSTANCE_METHOD
|
|
91
|
+
elif cls.is_common_function(method):
|
|
92
|
+
return FunctionKind.COMMON_FUNCTION
|
|
93
|
+
|
|
94
|
+
@staticmethod
|
|
95
|
+
def get_obj_init_params_for_funboost(obj_init_params: dict):
|
|
96
|
+
obj_init_params.pop('self')
|
|
97
|
+
return copy.deepcopy(obj_init_params)
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
if __name__ == '__main__':
|
|
101
|
+
pass
|
|
Binary file
|
funboost/utils/dependency_packages_in_pythonpath/__pycache__/add_to_pythonpath.cpython-39.pyc
CHANGED
|
Binary file
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
from aioredis.client import Redis, StrictRedis
|
|
2
|
-
from aioredis.connection import (
|
|
3
|
-
BlockingConnectionPool,
|
|
4
|
-
Connection,
|
|
5
|
-
ConnectionPool,
|
|
6
|
-
SSLConnection,
|
|
7
|
-
UnixDomainSocketConnection,
|
|
8
|
-
)
|
|
9
|
-
from aioredis.exceptions import (
|
|
10
|
-
AuthenticationError,
|
|
11
|
-
AuthenticationWrongNumberOfArgsError,
|
|
12
|
-
BusyLoadingError,
|
|
13
|
-
ChildDeadlockedError,
|
|
14
|
-
ConnectionError,
|
|
15
|
-
DataError,
|
|
16
|
-
InvalidResponse,
|
|
17
|
-
PubSubError,
|
|
18
|
-
ReadOnlyError,
|
|
19
|
-
RedisError,
|
|
20
|
-
ResponseError,
|
|
21
|
-
TimeoutError,
|
|
22
|
-
WatchError,
|
|
23
|
-
)
|
|
24
|
-
from aioredis.utils import from_url
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
def int_or_str(value):
|
|
28
|
-
try:
|
|
29
|
-
return int(value)
|
|
30
|
-
except ValueError:
|
|
31
|
-
return value
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
__version__ = "2.0.1"
|
|
35
|
-
VERSION = tuple(map(int_or_str, __version__.split(".")))
|
|
36
|
-
|
|
37
|
-
__all__ = [
|
|
38
|
-
"AuthenticationError",
|
|
39
|
-
"AuthenticationWrongNumberOfArgsError",
|
|
40
|
-
"BlockingConnectionPool",
|
|
41
|
-
"BusyLoadingError",
|
|
42
|
-
"ChildDeadlockedError",
|
|
43
|
-
"Connection",
|
|
44
|
-
"ConnectionError",
|
|
45
|
-
"ConnectionPool",
|
|
46
|
-
"DataError",
|
|
47
|
-
"from_url",
|
|
48
|
-
"InvalidResponse",
|
|
49
|
-
"PubSubError",
|
|
50
|
-
"ReadOnlyError",
|
|
51
|
-
"Redis",
|
|
52
|
-
"RedisError",
|
|
53
|
-
"ResponseError",
|
|
54
|
-
"SSLConnection",
|
|
55
|
-
"StrictRedis",
|
|
56
|
-
"TimeoutError",
|
|
57
|
-
"UnixDomainSocketConnection",
|
|
58
|
-
"WatchError",
|
|
59
|
-
]
|
|
1
|
+
from aioredis.client import Redis, StrictRedis
|
|
2
|
+
from aioredis.connection import (
|
|
3
|
+
BlockingConnectionPool,
|
|
4
|
+
Connection,
|
|
5
|
+
ConnectionPool,
|
|
6
|
+
SSLConnection,
|
|
7
|
+
UnixDomainSocketConnection,
|
|
8
|
+
)
|
|
9
|
+
from aioredis.exceptions import (
|
|
10
|
+
AuthenticationError,
|
|
11
|
+
AuthenticationWrongNumberOfArgsError,
|
|
12
|
+
BusyLoadingError,
|
|
13
|
+
ChildDeadlockedError,
|
|
14
|
+
ConnectionError,
|
|
15
|
+
DataError,
|
|
16
|
+
InvalidResponse,
|
|
17
|
+
PubSubError,
|
|
18
|
+
ReadOnlyError,
|
|
19
|
+
RedisError,
|
|
20
|
+
ResponseError,
|
|
21
|
+
TimeoutError,
|
|
22
|
+
WatchError,
|
|
23
|
+
)
|
|
24
|
+
from aioredis.utils import from_url
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def int_or_str(value):
|
|
28
|
+
try:
|
|
29
|
+
return int(value)
|
|
30
|
+
except ValueError:
|
|
31
|
+
return value
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
__version__ = "2.0.1"
|
|
35
|
+
VERSION = tuple(map(int_or_str, __version__.split(".")))
|
|
36
|
+
|
|
37
|
+
__all__ = [
|
|
38
|
+
"AuthenticationError",
|
|
39
|
+
"AuthenticationWrongNumberOfArgsError",
|
|
40
|
+
"BlockingConnectionPool",
|
|
41
|
+
"BusyLoadingError",
|
|
42
|
+
"ChildDeadlockedError",
|
|
43
|
+
"Connection",
|
|
44
|
+
"ConnectionError",
|
|
45
|
+
"ConnectionPool",
|
|
46
|
+
"DataError",
|
|
47
|
+
"from_url",
|
|
48
|
+
"InvalidResponse",
|
|
49
|
+
"PubSubError",
|
|
50
|
+
"ReadOnlyError",
|
|
51
|
+
"Redis",
|
|
52
|
+
"RedisError",
|
|
53
|
+
"ResponseError",
|
|
54
|
+
"SSLConnection",
|
|
55
|
+
"StrictRedis",
|
|
56
|
+
"TimeoutError",
|
|
57
|
+
"UnixDomainSocketConnection",
|
|
58
|
+
"WatchError",
|
|
59
|
+
]
|
funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/__init__.cpython-39.pyc
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/connection.cpython-39.pyc
CHANGED
|
Binary file
|
funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/exceptions.cpython-39.pyc
CHANGED
|
Binary file
|
|
Binary file
|