极简事件系统(处理程序包)

visitoolkit-eventsystem的Python项目详细描述


VisiToolkit事件系统

极简事件系统

通过pip安装 https://pypi.org/project/visitoolkit-eventsystem
(在Python 3上运行)

说明

当事件被触发时被调用的注册处理程序(处理程序包)
使用“axel事件”中的思想https://github.com/axel-events/axel
以及来自http://www.valuedlessons.com/2008/04/events-in-python.html的“事件系统”

用法

fromvisitoolkit_eventsystemimporteventsystem# handlers are callback functions in your code,# when firing an event visitoolkit_eventsystem will call them with the given argument(s)defcb1(event_id,*arg,**args):ifevent_id>0:# handle event...returnTrueelse:returnFalse# Default is synchronous execution of handlers (blocking main thread, collecting all results)# sync_mode=False means asynchronous execution of handlers (one background thread calls all handlers) # =>Details about flag "exc_info"(default is True): https://docs.python.org/3/library/sys.html#sys.exc_info# =>Flag "traceback" (default is False) controls verbosity of error_info when an exception occurredes=eventsystem.EventSystem(sync_mode=True)# adding or removing handlers in list-like syntaxes+=cb1#The execution result is returned as a list containing all results per handler having this structure:#  exec_result = [#      (True, result, handler),        # on success#      (False, error_info, handler),   # on error#      (None, None, handler), ...      # asynchronous execution#  ]# firing eventresult=es(42)

提高错误查找的日志记录级别:

importlogginglogging.getLogger('visitoolkit_eventsystem').setLevel(logging.DEBUG)

背景资料

visitolkit\u eventsystemvisitolkit\u连接器中用作visitolkit的核心部分。

visitolkit是为专有的构建和过程管理系统编写的 “促销(C)MST SystemTechnik AG”
(也称为“SAIA Visi.Plus”(C)SAIA Burgess控制公司)

意图:
支持可视化项目的创建者…
提高效率…
减少容易出错的手动过程…
添加缺少的功能…

免责声明:使用“visitolkit”的风险自负

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
Java泛型重写抽象方法并具有子类的返回类型   Java中的字符串反转字符,同时保留一些字符   java将系统时间与我获取它的时间进行比较   java解析ODATA URL以在准备entityset之前读取ID值   java中的有界通配符下界泛型即使在传递超类时也不会编译   c#Java的JVM和Java的内部工作方式有什么不同。NET的CLR?   java如何在windows7上指定JDK的版本?   Java:列出单个目录中的所有文件(1020000+)   java使用Logback和Lombok   安卓谷歌玩java。lang.NullPointerException   使用RSA的解密结果在普通Java和Android中有所不同   具有默认连接池的java Spring引导   java我如何在一个坏的测试环境中前进?