36 lines
784 B
Python
36 lines
784 B
Python
import os
|
|
import sys
|
|
from config import Config
|
|
from plugins import WaitPlugin
|
|
from plugin_repository import PluginRepository
|
|
from program_executor import ProgramExecutor
|
|
import logging
|
|
|
|
|
|
def main():
|
|
# init
|
|
logging.basicConfig(
|
|
stream=sys.stdout,
|
|
format="%(asctime)s [%(levelname)s]: %(name)s: %(message)s",
|
|
level=logging.DEBUG
|
|
)
|
|
compiler_repo = PluginRepository()
|
|
compiler_repo.register_plugin(WaitPlugin)
|
|
|
|
# Example code:
|
|
compiler_repo.load_plugin("wait")
|
|
program = []
|
|
program.append(compiler_repo.get_compiler("wait").compile(secs=2))
|
|
|
|
# execute:
|
|
executor = ProgramExecutor(program)
|
|
executor.start()
|
|
|
|
# End of execution
|
|
executor.join()
|
|
compiler_repo.close()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|