Renamed wait plugin to sleep

This commit is contained in:
2021-04-11 13:57:56 +02:00
parent 7d30328e21
commit 203b513c9e
3 changed files with 16 additions and 16 deletions

View File

@@ -1,3 +1,3 @@
from .abstract_plugin import AbstractCommand, AbstractCommandCompiler, AbstractPlugin
from .wait_plugin import WaitPlugin
from .sleep_plugin import SleepPlugin
from .sync_plugin import SyncPlugin

View File

@@ -5,7 +5,7 @@ import logging
import time
class WaitCommand(AbstractCommand):
class SleepCommand(AbstractCommand):
def __init__(self, logger: logging.Logger, secs: float):
@@ -25,31 +25,31 @@ class WaitCommand(AbstractCommand):
def describe(self) -> dict:
return {
"command": "wait",
"command": "sleep",
"params": {
"secs": self._secs
}
}
class WaitCompiler(AbstractCommandCompiler):
class SleepCompiler(AbstractCommandCompiler):
def __init__(self, logger: logging.Logger):
self._logger = logger
def compile(self, secs: float) -> AbstractCommand:
return WaitCommand(self._logger, secs)
return SleepCommand(self._logger, secs)
class WaitPlugin(AbstractPlugin):
plugin_name = "wait"
class SleepPlugin(AbstractPlugin):
plugin_name = "sleep"
def __init__(self):
self._logger = logging.getLogger("plugin").getChild("wait")
self._logger = logging.getLogger("plugin").getChild("sleep")
def load_compilers(self) -> Dict[str, AbstractCommandCompiler]:
return {
"wait": WaitCompiler(self._logger)
"sleep": SleepCompiler(self._logger)
}
def close(self):