用于跟踪python中可调用函数执行情况的python实用程序
ctodd-python-lib-execution的Python项目详细描述
Christopher H.Todd的用于包装可调用执行的Python库
ctodd python lib执行项目负责将python中的可调用函数打包到函数日志、执行时间和其他生命质量改进中。对于使用开始和停止计时器包装函数很有用。
目录
依赖关系
python包
- Wrapt=1.11.1
库
function_executors.py
用于记录脚本的任何可调用函数或main()函数的执行详细信息的库。
功能:
def main_executor(wrapped, instance, args, kwargs):
"""
Purpose:
Decorator for running the main() function. Decorator will
log the start and completion of the script, time the
execution and performance of the script, and handle
and exceptions (log the exception to the log file and raise)
Args:
wrapped (main function):
instance: pass in self when wrapping class method.
default is None when wrapping function.
args (Tuple): List of arguments
kwargs (Dict): Dictionary of named arguments
"""
脚本示例
用于测试和与库交互的示例可执行python脚本/模块。这些示例显示了库的用例,可以用作与库一起开发的模板,也可以用作一次性开发工作。
不适用
注释
- 依赖于f-string符号,它仅限于python3.6。通过重构删除这些内容,可以使用python3.0.x到3.5.x进行开发
待办事项
- UnitTest框架已就位,但缺少测试