예제 #1
0
파일: parser.py 프로젝트: michelts/aloe
    def max_length(self):
        """
        The max length of the feature, description and child blocks
        """

        return max(
            0,
            strings.get_terminal_width(self.represented(table=False, multiline=False)),
            *[strings.get_terminal_width(line) for line in self.represent_table().splitlines()]
        )
예제 #2
0
    def max_length(self):
        """
        The max horizontal length of the feature, description and child blocks.
        """

        return max(
            0, strings.get_terminal_width(self.represented()),
            *([step.max_length for step in self.steps] + [
                strings.get_terminal_width(line)
                for line in self.represent_outlines().splitlines()
            ]))
예제 #3
0
    def max_length(self):
        """
        The max horizontal length of the feature, description and child blocks.
        """

        return max(
            0,
            strings.get_terminal_width(self.represented()),
            *([step.max_length for step in self.steps] +
              [strings.get_terminal_width(line)
               for line in self.represent_outlines().splitlines()])
        )
예제 #4
0
    def max_length(self):
        """
        The max length of the feature, description and child blocks
        """

        return max(
            0,
            strings.get_terminal_width(
                self.represented(table=False, multiline=False)), *[
                    strings.get_terminal_width(line)
                    for line in self.represent_table().splitlines()
                ])
예제 #5
0
def test_column_width_w_number_and_char():
    """strings.column_width_w_number_and_char"""

    assert_equal(
        strings.get_terminal_width(u"%s%c" % (u"4209", 0x4209)),
        6
    )
예제 #6
0
def test_column_width():
    """strings.column_width"""

    assert_equal(
        strings.get_terminal_width(u"あいうえお"),
        10
    )
예제 #7
0
파일: test_strings.py 프로젝트: kiawin/aloe
def test_column_width_w_number_and_char():
    """strings.column_width_w_number_and_char"""

    assert_equal(
        strings.get_terminal_width(u"%s%c" % (u"4209", 0x4209)),
        6
    )
예제 #8
0
파일: test_strings.py 프로젝트: kiawin/aloe
def test_column_width():
    """strings.column_width"""

    assert_equal(
        strings.get_terminal_width(u"あいうえお"),
        10
    )
예제 #9
0
파일: parser.py 프로젝트: michelts/aloe
 def max_length(self):
     """
     The maximum length of all description lines.
     """
     try:
         return max(strings.get_terminal_width(self.represent_line(n)) for n, _ in enumerate(self.lines))
     except ValueError:
         return 0
예제 #10
0
 def max_length(self):
     """
     The maximum length of all description lines.
     """
     try:
         return max(
             strings.get_terminal_width(self.represent_line(n))
             for n, _ in enumerate(self.lines))
     except ValueError:
         return 0
예제 #11
0
    def max_length(self):
        """
        The max horizontal length of the feature, description and child blocks.

        This is used for aligning rendered output.
        """

        return max(
            0, strings.get_terminal_width(self.represented(description=False)),
            self.description_node.max_length,
            *[scenario.max_length for scenario in self.scenarios])
예제 #12
0
파일: parser.py 프로젝트: michelts/aloe
    def max_length(self):
        """
        The max horizontal length of the feature, description and child blocks.

        This is used for aligning rendered output.
        """

        return max(
            0,
            strings.get_terminal_width(self.represented(description=False)),
            self.description_node.max_length,
            *[scenario.max_length for scenario in self.scenarios]
        )