-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e724b20
commit e2b000a
Showing
11 changed files
with
158 additions
and
47 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
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
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
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
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
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
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
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,8 +1,10 @@ | ||
from neetbox.config import get_module_level_config | ||
from neetbox.logging.logger import DEFAULT_LOGGER as logger | ||
from neetbox.logging.logger import set_log_level | ||
|
||
_cfg = get_module_level_config() | ||
logger.set_log_dir(_cfg["logdir"]) | ||
set_log_level(_cfg["level"]) | ||
from neetbox.logging.logger import LogSplitStrategies | ||
|
||
__all__ = ["logger", "LogSplitStrategies"] |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
class LogWriter: | ||
def write(self, raw_msg): | ||
pass | ||
|
||
|
||
class ConsoleLogWriter(metaclass=LogWriter): | ||
def __init__(self) -> None: | ||
pass | ||
|
||
def write(self, raw_msg): | ||
pass | ||
|
||
|
||
class FileLogWriter(metaclass=LogWriter): | ||
def __init__(self) -> None: | ||
pass | ||
|
||
def write(self, raw_msg): | ||
pass | ||
|
||
|
||
class WebSocketLogWriter(metaclass=LogWriter): | ||
def __init__(self) -> None: | ||
pass | ||
|
||
def write(self, raw_msg): | ||
pass |
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
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
def test_neet_action(): | ||
import time | ||
|
||
from neetbox.daemon import NeetActionManager, action | ||
|
||
@action(name="some_func") | ||
def some(a, b): | ||
time.sleep(1) | ||
return f"a = {a}, b = {b}" | ||
|
||
print("registered actions:") | ||
action_dict = NeetActionManager.get_action_dict() | ||
print(action_dict) | ||
|
||
def callback_fun(text): | ||
print(f"callback_fun print: {text}") | ||
|
||
NeetActionManager.eval_call("some", {"a": "3", "b": "4"}, callback=callback_fun) | ||
print("you should see this line first before callback_fun print") | ||
time.sleep(4) |