pyfunceble_docker/base.py
def log_response(cls, response: dict):
        """
        Given a response from the Docker client.
        We log it.
        """

        if "stream" in response:
            for line in response["stream"].splitlines():
                if line:
                    logging.info(line)

        if "progressDetail" in response and "status" in response:
            if "id" in response and response["progressDetail"]:
                percentage = round(
                    (response["progressDetail"]["current"] * 100)
                    / response["progressDetail"]["total"],
                    2,
                )

                logging.info(
                    "%s (%s): %s/%s (%s%%)",
                    response["status"],
                    response["id"],
                    response["progressDetail"]["current"],
                    response["progressDetail"]["total"],
                    percentage,
                )
            elif "id" in response:
                logging.info("%s (%s)", response["status"], response["id"])
            else:
                logging.info("%s", response["status"])
        elif "errorDetail" in response and response["errorDetail"]:
            raise Exception(response["errorDetail"]["message"])
        elif "status" in response:
            logging.info("%s", response["status"])

        Given a response from the Docker client.
        We log it.
        
Given a response from the Docker client.
We log it.
Given a response from the Docker client . We log it .
def log_response(cls, response: dict):
        if "stream" in response:
            for line in response["stream"].splitlines():
                if line:
                    logging.info(line)
        if "progressDetail" in response and "status" in response:
            if "id" in response and response["progressDetail"]:
                percentage = round(
                    (response["progressDetail"]["current"] * 100)
                    / response["progressDetail"]["total"],
                    2,
                )
                logging.info(
                    "%s (%s): %s/%s (%s%%)",
                    response["status"],
                    response["id"],
                    response["progressDetail"]["current"],
                    response["progressDetail"]["total"],
                    percentage,
                )
            elif "id" in response:
                logging.info("%s (%s)", response["status"], response["id"])
            else:
                logging.info("%s", response["status"])
        elif "errorDetail" in response and response["errorDetail"]:
            raise Exception(response["errorDetail"]["message"])
        elif "status" in response:
            logging.info("%s", response["status"])
def log_response ( cls , response : dict ) : if "stream" in response : for line in response [ "stream" ] . splitlines ( ) : if line : logging . info ( line ) if "progressDetail" in response and "status" in response : if "id" in response and response [ "progressDetail" ] : percentage = round ( ( response [ "progressDetail" ] [ "current" ] * 100 ) / response [ "progressDetail" ] [ "total" ] , 2 , ) logging . info ( "%s (%s): %s/%s (%s%%)" , response [ "status" ] , response [ "id" ] , response [ "progressDetail" ] [ "current" ] , response [ "progressDetail" ] [ "total" ] , percentage , ) elif "id" in response : logging . info ( "%s (%s)" , response [ "status" ] , response [ "id" ] ) else : logging . info ( "%s" , response [ "status" ] ) elif "errorDetail" in response and response [ "errorDetail" ] : raise Exception ( response [ "errorDetail" ] [ "message" ] ) elif "status" in response : logging . info ( "%s" , response [ "status" ] )
Given a response from the Docker client.
Given a response from the Docker client .
"""
        Given a response from the Docker client.
        We log it.
        """
cls
response
dict