shadowshell 0.0.30__tar.gz → 0.0.32__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.
- {shadowshell-0.0.30 → shadowshell-0.0.32}/PKG-INFO +1 -1
- {shadowshell-0.0.30 → shadowshell-0.0.32}/pyproject.toml +1 -1
- {shadowshell-0.0.30 → shadowshell-0.0.32}/src/shadowshell/__init__.py +2 -2
- {shadowshell-0.0.30 → shadowshell-0.0.32}/src/shadowshell/bootstrap.py +23 -9
- {shadowshell-0.0.30 → shadowshell-0.0.32}/src/shadowshell.egg-info/PKG-INFO +1 -1
- {shadowshell-0.0.30 → shadowshell-0.0.32}/README.md +0 -0
- {shadowshell-0.0.30 → shadowshell-0.0.32}/setup.cfg +0 -0
- {shadowshell-0.0.30 → shadowshell-0.0.32}/src/shadowshell/configurator.py +0 -0
- {shadowshell-0.0.30 → shadowshell-0.0.32}/src/shadowshell/console_logger.py +0 -0
- {shadowshell-0.0.30 → shadowshell-0.0.32}/src/shadowshell/git_shell.py +0 -0
- {shadowshell-0.0.30 → shadowshell-0.0.32}/src/shadowshell/logger.py +0 -0
- {shadowshell-0.0.30 → shadowshell-0.0.32}/src/shadowshell/logger_factory.py +0 -0
- {shadowshell-0.0.30 → shadowshell-0.0.32}/src/shadowshell/stock_trader.py +0 -0
- {shadowshell-0.0.30 → shadowshell-0.0.32}/src/shadowshell.egg-info/SOURCES.txt +0 -0
- {shadowshell-0.0.30 → shadowshell-0.0.32}/src/shadowshell.egg-info/dependency_links.txt +0 -0
- {shadowshell-0.0.30 → shadowshell-0.0.32}/src/shadowshell.egg-info/requires.txt +0 -0
- {shadowshell-0.0.30 → shadowshell-0.0.32}/src/shadowshell.egg-info/top_level.txt +0 -0
- {shadowshell-0.0.30 → shadowshell-0.0.32}/tests/tests.py +0 -0
|
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "shadowshell" # 全局唯一名称(检查PyPI是否被占用)
|
|
7
7
|
#version = "0.0.24" # 版本号(每次更新需递增)
|
|
8
|
-
version = "0.0.
|
|
8
|
+
version = "0.0.32" # 版本号(每次更新需递增)
|
|
9
9
|
authors = [{ name = "shadowshell", email = "shadowshellxyz@foxmail.com" }]
|
|
10
10
|
description = "www.shadowshell.xyz"
|
|
11
11
|
readme = "README.md"
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
from shadowshell.logger import Logger
|
|
9
9
|
from shadowshell.logger_factory import LoggerFactory
|
|
10
|
-
from shadowshell.bootstrap import ShadowShell, performance_monitor, hello, shadowshell, invoke_with_tmpl, TestTemplate, testserver, cnnserver
|
|
10
|
+
from shadowshell.bootstrap import ShadowShell, performance_monitor, function_monitor, hello, shadowshell, invoke_with_tmpl, TestTemplate, testserver, cnnserver
|
|
11
11
|
from shadowshell.git_shell import GitShell
|
|
12
12
|
from shadowshell.configurator import Configurator
|
|
13
13
|
|
|
14
|
-
__all__ = ['ShadowShell', 'performance_monitor', 'hello', 'shadowshell', 'Configurator', 'invoke_with_tmpl', 'TestTemplate', 'Logger', 'LoggerFactory', 'GitShell', 'testserver', 'cnnserver']
|
|
14
|
+
__all__ = ['ShadowShell', 'performance_monitor', 'function_monitor', 'hello', 'shadowshell', 'Configurator', 'invoke_with_tmpl', 'TestTemplate', 'Logger', 'LoggerFactory', 'GitShell', 'testserver', 'cnnserver']
|
|
@@ -9,15 +9,6 @@ import time
|
|
|
9
9
|
|
|
10
10
|
logger = LoggerFactory().get_logger()
|
|
11
11
|
|
|
12
|
-
def performance_monitor(func):
|
|
13
|
-
def wrapper(*args, **kwargs):
|
|
14
|
-
start = time.perf_counter()
|
|
15
|
-
result = func(*args, **kwargs)
|
|
16
|
-
elapsed = time.perf_counter() - start
|
|
17
|
-
logger.info(f"[{func.__name__}] has ran, time elapsed:{elapsed:.6f} s.")
|
|
18
|
-
return result
|
|
19
|
-
return wrapper
|
|
20
|
-
|
|
21
12
|
"""
|
|
22
13
|
ShadowShell
|
|
23
14
|
|
|
@@ -81,6 +72,29 @@ class TestTemplate:
|
|
|
81
72
|
self.logger.debug('Nothing')
|
|
82
73
|
return
|
|
83
74
|
|
|
75
|
+
def performance_monitor(func):
|
|
76
|
+
def wrapper(*args, **kwargs):
|
|
77
|
+
start = time.perf_counter()
|
|
78
|
+
result = func(*args, **kwargs)
|
|
79
|
+
elapsed = time.perf_counter() - start
|
|
80
|
+
logger.info(f"[PERFORMANCE_MONITOR][{func.__name__}] has ran, time elapsed:{elapsed:.6f} s.")
|
|
81
|
+
return result
|
|
82
|
+
return wrapper
|
|
83
|
+
|
|
84
|
+
def function_monitor(func):
|
|
85
|
+
def wrapper(*args, **kwargs):
|
|
86
|
+
start = time.perf_counter()
|
|
87
|
+
try:
|
|
88
|
+
result = func(*args, **kwargs)
|
|
89
|
+
except Exception as e:
|
|
90
|
+
logger.error(e)
|
|
91
|
+
except:
|
|
92
|
+
logger.error(sys.exc_info()[0])
|
|
93
|
+
finally:
|
|
94
|
+
elapsed = time.perf_counter() - start
|
|
95
|
+
logger.info(f"[FUNCTION_MONITOR][{func.__name__}] has ran, time elapsed:{elapsed:.6f} s.")
|
|
96
|
+
return result
|
|
97
|
+
return wrapper
|
|
84
98
|
|
|
85
99
|
def testserver():
|
|
86
100
|
os.system("ping shadowshell.xyz")
|
|
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
|