def __init__(
        self,
        parent,
        position,
        content_view=None,
        absolute_position=None,
        logger=None,
        use_index_as_parent=False,
    ):

        super(ExpandableColumn, self).__init__(parent,
                                               position,
                                               absolute_position,
                                               logger=logger)

        # Sometimes expandable content's 'tr' index is dictated by the position of the column
        # Most of the time it is the second index.
        if use_index_as_parent:
            content_parent = Text(parent=self.row,
                                  locator=f"./tr[{position + 1}]")
        else:
            content_parent = Text(parent=self.row, locator="./tr[2]")

        if isinstance(content_view, dict):
            content_view = content_view.get(position)

        if content_view:
            self.content = resolve_table_widget(content_parent, content_view)
        else:
            self.content = content_parent
Example #2
0
    def __init__(self, parent, index, content_view=None, logger=None):
        super(ExpandableTableRow, self).__init__(parent, index, logger=logger)

        content_parent = Text(parent=self, locator=self.EXPANDABLE_CONTENT)
        if content_view:
            self.content = resolve_table_widget(content_parent, content_view)
        else:
            self.content = content_parent
Example #3
0
    def __init__(self, parent, position, content_view=None, absolute_position=None, logger=None):
        super(ExpandableColumn, self).__init__(parent, position, absolute_position, logger=logger)

        expandable_content = f"./tr[{position + 1}]"
        content_parent = Text(parent=self.row, locator=expandable_content)
        if content_view:
            self.content = resolve_table_widget(content_parent, content_view)
        else:
            self.content = content_parent
    def __init__(self,
                 parent,
                 position,
                 content_view=None,
                 absolute_position=None,
                 logger=None):
        super(ExpandableColumn, self).__init__(parent,
                                               position,
                                               absolute_position,
                                               logger=logger)

        # expandable content is always the 2nd tr
        content_parent = Text(parent=self.row, locator=self.EXPANDABLE_CONTENT)
        if content_view:
            self.content = resolve_table_widget(content_parent, content_view)
        else:
            self.content = content_parent