idasen_controller/main.py
async def main():
    """Set up the async event loop and signal handlers"""
    try:
        client = None
        # Forward and scan don't require a connection so run them and exit
        if config['forward']:
            await forward_command(config)
        elif config['scan_adapter']:
            await scan()
        else:
            # Server and other commands do require a connection so set one up
            client = await connect()
            if config['server']:
                await run_server(client, config)
            else:
                await run_command(client, config)
    except Exception:
        # These exceptions are set up weird. Do not like.
        pass
    finally:
        if client:
            print('\rDisconnecting\r', end="")
            await stop(client)
            await disconnect(client)
            print('Disconnected         ')
Set up the async event loop and signal handlers
Set up the async event loop and signal handlers
Set up the async event loop and signal handlers
async def main():
    try:
        client = None
        if config['forward']:
            await forward_command(config)
        elif config['scan_adapter']:
            await scan()
        else:
            client = await connect()
            if config['server']:
                await run_server(client, config)
            else:
                await run_command(client, config)
    except Exception:
        pass
    finally:
        if client:
            print('\rDisconnecting\r', end="")
            await stop(client)
            await disconnect(client)
            print('Disconnected         ')
async def main ( ) : try : client = None if config [ 'forward' ] : await forward_command ( config ) elif config [ 'scan_adapter' ] : await scan ( ) else : client = await connect ( ) if config [ 'server' ] : await run_server ( client , config ) else : await run_command ( client , config ) except Exception : pass finally : if client : print ( '\rDisconnecting\r' , end = "" ) await stop ( client ) await disconnect ( client ) print ( 'Disconnected         ' )
Set up the async event loop and signal handlers
Set up the async event loop and signal handlers
"""Set up the async event loop and signal handlers""" # Forward and scan don't require a connection so run them and exit # Server and other commands do require a connection so set one up # These exceptions are set up weird. Do not like.