diff options
Diffstat (limited to 'logilab/common/table.py')
-rw-r--r-- | logilab/common/table.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/logilab/common/table.py b/logilab/common/table.py index 983708b..46216d9 100644 --- a/logilab/common/table.py +++ b/logilab/common/table.py @@ -21,7 +21,8 @@ from __future__ import print_function from types import CodeType from typing import Any, List, Optional, Tuple, Union, Dict, Iterator from _io import StringIO -from mypy_extensions import NoReturn + +import re __docformat__ = "restructuredtext en" @@ -82,7 +83,7 @@ class Table(object): def __len__(self) -> int: return len(self.row_names) - ## Rows / Columns creation ################################################# + # Rows / Columns creation ################################################# def create_rows(self, row_names: List[str]) -> None: """Appends row_names to the list of existing rows """ @@ -110,7 +111,7 @@ class Table(object): for row in self.data: row.append(self.default_value) - ## Sort by column ########################################################## + # Sort by column ########################################################## def sort_by_column_id(self, col_id: str, method: str = "asc") -> None: """Sorts the table (in-place) according to data stored in col_id """ @@ -176,7 +177,7 @@ class Table(object): if row[col_index] == value: self.data.remove(row) - ## The 'setter' part ####################################################### + # The 'setter' part ####################################################### def set_cell(self, row_index: int, col_index: int, data: int) -> None: """sets value of cell 'row_indew', 'col_index' to data """ @@ -332,7 +333,7 @@ class Table(object): except ValueError: raise KeyError("Column (%s) not found in table" % (col_id)) - ## The 'getter' part ####################################################### + # The 'getter' part ####################################################### def get_shape(self) -> Tuple[int, int]: """Returns a tuple which represents the table's shape @@ -649,8 +650,6 @@ class TableStyle: return self.units[col_id] -import re - CELL_PROG = re.compile("([0-9]+)_([0-9]+)") |