# cPy - Python Web GUI.
# Copyright by Anthony Vogelaar, Perth Scotland
# rev 0.10  2026-02-22  Initial release

import	asyncio
from    m_microdot  import  microdotSetup

# ========================== Main ===============================

class Main:

    def __init__(self):
        asyncio.run(self.aioInit())


    async def aioInit(self):
        try:
            async with asyncio.TaskGroup() as tg:
                microdotSetup(tg, self)
        except* Exception as exc: print(exc.exceptions)
        finally                 : print('taskgroup terminated')


    def doCommand(self, cmd):
        try:
            for k, v in cmd.items():
                if k == 'edit':
                    print(v)
                    return ({'memo': f'echo {v}'})
                else: print(cmd)
        except: print('Main.doCommand: exception')


Main()

# =========================== end ==============================
