Draws a progress bar on screen based on the given information using standard output (stdout).
        :param task: TaskProgress object containing all required information to draw a progress bar at the given state.

def print_progress_bar(self, task):
        """
        Draws a progress bar on screen based on the given information using standard output (stdout).
        :param task: TaskProgress object containing all required information to draw a progress bar at the given state.
        """
        str_format = "{0:." + str(task.decimals) + "f}"
        percents = str_format.format(100 * (task.progress / float(task.total)))
        filled_length = int(round(task.bar_length * task.progress / float(task.total)))
        bar = '█' * filled_length + '-' * (task.bar_length - filled_length)

        # Build elapsed time if needed
        elapsed_time = None

        if task.display_time:
            if task.end_time:
                # If the task has ended, stop the chrono
                if not task.elapsed_time_at_end:
                    task.elapsed_time_at_end = self.millis_to_human_readable(task.end_time - task.begin_time)
                elapsed_time = task.elapsed_time_at_end
            else:
                # If task is new then start the chrono
                if not task.begin_time:
                    task.begin_time = millis()
                elapsed_time = self.millis_to_human_readable(millis() - task.begin_time)

        prefix_pattern = '%{}s'.format(self.longest_bar_prefix_size)
        time_container_pattern = '(%s)' if task.display_time and not task.end_time else '[%s]'

        if len(task.suffix) > 0 and task.display_time:
            sys.stdout.write('\n {} |%s| %3s %% {} - %s'.format(prefix_pattern, time_container_pattern)
                             % (task.prefix, bar, percents, elapsed_time, task.suffix))
        elif len(task.suffix) > 0 and not task.display_time:
            sys.stdout.write('\n {} |%s| %3s %% - %s'.format(prefix_pattern)
                             % (task.prefix, bar, percents, task.suffix))
        elif task.display_time and not len(task.suffix) > 0:
            sys.stdout.write('\n {} |%s| %3s %% {}'.format(prefix_pattern, time_container_pattern)
                             % (task.prefix, bar, percents, elapsed_time))
        else:
            sys.stdout.write('\n {} |%s| %3s %%'.format(prefix_pattern)
                             % (task.prefix, bar, percents))

        sys.stdout.write('\n')
        sys.stdout.flush()