Skip to content

Commit 71a745e

Browse files
authored
hosts: new widget for Hosts table (#1465)
The `SatTable` widget is modified to ignore hidden headers and columns in the table. Hidden duplicate columns cause the widget to work incorrectly internally, while on the outside everything seems in order. This behavior is especially present in the Hosts table, where instead of seemingly interacting with the visible columns, the widget interacts with the hidden ones. The table widget for Hosts somehow worked properly(-ish), until commit 886a1a8 exposed this flaw. Excluding the hidden columns during the table cells collection by the widget solves the problem.
1 parent 015bbc7 commit 71a745e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

airgun/widgets.py

+6
Original file line numberDiff line numberDiff line change
@@ -1881,6 +1881,8 @@ class SatTable(Table):
18811881
If the table is empty, there might be only one column with an appropriate message in the table
18821882
body, or it may have no columns or rows at all. This subclass handles both possibilities.
18831883
1884+
It also ignores all hidden columns, which some tables might contain, like the Hosts table.
1885+
18841886
Example html representation::
18851887
18861888
<table bst-table="table" ...>
@@ -1907,6 +1909,10 @@ class SatTable(Table):
19071909
19081910
"""
19091911

1912+
HEADERS = "./thead/tr/th[not(@hidden)]|./tr/th[not(@hidden)]|./thead/tr/td[not(@hidden)]"
1913+
COLUMN_RESOLVER_PATH = "/td[not(@hidden)]"
1914+
COLUMN_AT_POSITION = "./td[not(@hidden)][{0}]"
1915+
19101916
no_rows_message = (
19111917
".//td/span[contains(@data-block, 'no-rows-message') or "
19121918
"contains(@data-block, 'no-search-results-message')]"

0 commit comments

Comments
 (0)