forked from LiteLDev/LeviLamina
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: LiteLDev#1200 (LiteLDev#1203)
- Loading branch information
Showing
1 changed file
with
11 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |