Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
lgc2333 authored and ShrBox committed Apr 20, 2023
1 parent ca5d015 commit 46622be
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions ScriptEngine/assets/BaseLib.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
def _llse_python_base_lib_listener(event):
def _llse_python_base_lib_handle(event):
def wrapper(func):
__builtins__.mc.listen(event, func)
return func

return wrapper


def _llse_python_base_lib_command_callback(self, func):
self.setCallback(func)
return func
def _llse_python_base_lib_command_handle(self, func=None):
def wrapper(func):
self.setCallback(func)
return func

if func:
return wrapper(func)
return wrapper


setattr(__builtins__, "listener", _llse_python_base_lib_listener)
setattr(__builtins__.LLSE_Command, "callback", _llse_python_base_lib_command_callback)
setattr(__builtins__, "handle", _llse_python_base_lib_handle)
setattr(__builtins__.LLSE_Command, "handle", _llse_python_base_lib_command_handle)

0 comments on commit 46622be

Please sign in to comment.