Beispiel #1
0
def reformat(conffile, only_client, only_server):
    try:
        commands = Commands(conffile, verify=True)

        # client or server
        process_client = True
        process_server = True
        if only_client and not only_server:
            process_server = False
        if only_server and not only_client:
            process_client = False

        if process_client:
            try:
                reformat_side(commands, CLIENT)
            except CalledProcessError:
                # astyle failed
                commands.logger.error('Reformat of client failed')

        if process_server:
            try:
                reformat_side(commands, SERVER)
            except CalledProcessError:
                # astyle failed
                commands.logger.error('Reformat of server failed')
    except Exception:  # pylint: disable-msg=W0703
        logging.exception('FATAL ERROR')
        sys.exit(1)
def reformat(conffile, only_client, only_server):
    try:
        commands = Commands(conffile, verify=True)

        # client or server
        process_client = True
        process_server = True
        if only_client and not only_server:
            process_server = False
        if only_server and not only_client:
            process_client = False

        if process_client:
            try:
                reformat_side(commands, CLIENT)
            except CalledProcessError:
                # astyle failed
                commands.logger.error('Reformat of client failed')

        if process_server:
            try:
                reformat_side(commands, SERVER)
            except CalledProcessError:
                # astyle failed
                commands.logger.error('Reformat of server failed')
    except Exception:  # pylint: disable-msg=W0703
        logging.exception('FATAL ERROR')
        sys.exit(1)
Beispiel #3
0
def reformat(conffile):
    try:
        commands = Commands(conffile, verify=True)

        try:
            reformat_side(commands, CLIENT)
            reformat_side(commands, SERVER)
        except CalledProcessError:
            # astyle failed
            commands.logger.error('Reformat failed')
            sys.exit(1)
    except Exception:  # pylint: disable-msg=W0703
        logging.exception('FATAL ERROR')
        sys.exit(1)