mirror of
https://github.com/koloideal/Argenta.git
synced 2026-06-10 18:15:28 +03:00
31 lines
766 B
Python
31 lines
766 B
Python
from argenta import App, Orchestrator
|
|
from argenta.app import PredefinedMessages, StaticDividingLine
|
|
from mock.mock_app.routers import work_router
|
|
|
|
def print_hello(entity: str):
|
|
with open('hello.txt', 'a') as file:
|
|
file.write(f'printer called: {entity}\n')
|
|
print(entity)
|
|
|
|
app: App = App(
|
|
dividing_line=StaticDividingLine(),
|
|
override_system_messages=True,
|
|
print_func=print_hello
|
|
)
|
|
orchestrator: Orchestrator = Orchestrator()
|
|
|
|
|
|
def main():
|
|
app.include_router(work_router)
|
|
|
|
app.add_message_on_startup(PredefinedMessages.USAGE)
|
|
app.add_message_on_startup(PredefinedMessages.AUTOCOMPLETE)
|
|
app.add_message_on_startup(PredefinedMessages.HELP)
|
|
|
|
orchestrator.start_polling(app)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|
|
|
|
|