示例#1
0
    def _row(self, name=None, description=None, dependencies=None, dependent_of=None,
             max_name_length=20):
        """
        Output table row message.

        :param name: the task name
         :type name: str
        :param description: the task description
         :type description: str
        :param dependencies: the task's dependencies
         :type dependencies: list or str
        :param max_name_length: the length of the longest task name in the table
         :type max_name_length: int
        :return: None
        """
        if description is None:
            description = ''
        if dependencies is None:
            dependencies = []

        (console_width, console_height) = get_terminal_size()

        c1_width = max_name_length + 8
        c2_width = console_width - 5 - c1_width

        self._row_list('herring ' + name, description, c1_width, c2_width)
        if dependencies:
            self._row_list('', 'depends: ' + repr(dependencies), c1_width, c2_width)
        if dependent_of is not None:
            self._row_list('', 'dependent_of: ' + dependent_of, c1_width, c2_width)
示例#2
0
    def _header(self, message):
        """
        Output table header message followed by a horizontal rule.

        :param message: the table header text
         :type message: str
        :return: None
        """
        (console_width, console_height) = get_terminal_size()
        info(message)
        info("=" * console_width)