예제 #1
0
파일: linot.py 프로젝트: KavenC/Linot
def cmd_process(args, sender):
    if args.stopserver:
        if sender.code == config['interface'][sender.interface_name]['admin_id']:
            sender.send_message('Server is shutting down')
            logger.info('server is shutting down')
            for service in service_instances:
                logger.debug('stopping service: ' + service)
                service_instances[service].stop()
                logger.debug(service + ' is stopped')
            logger.debug('stopping command server')
            command_server.stop()
        return

    if args.listservices:
        msg = io.BytesIO()
        for service in service_instances:
            print(service_instances[service], file=msg)
        sender.send_message(msg.getvalue())
        return
예제 #2
0
파일: linot.py 프로젝트: hpeter/Linot
def cmd_process(args, sender):
    if args.stopserver:
        if sender.code == config['interface'][sender.interface_name]['admin_id']:
            sender.send_message('Server is shutting down')
            logger.info('server is shutting down')
            for service in service_instances:
                logger.debug('stopping service: ' + service)
                service_instances[service].stop()
                logger.debug(service + ' is stopped')
            logger.debug('stopping command server')
            command_server.stop()
        return

    if args.listservices:
        msg = io.BytesIO()
        for service in service_instances:
            print(service_instances[service], file=msg)
        sender.send_message(msg.getvalue())
        return
예제 #3
0
def stop(wait=True):
    """Stop command receiving thread"""
    command_server.stop()
    pass