DUNE-DAQ
DUNE Trigger and Data Acquisition software
|
Public Member Functions | |
__init__ (self, max_width=80) | |
reset (self) | |
set_chars (self, array) | |
set_deco (self, deco) | |
set_cols_align (self, array) | |
set_cols_valign (self, array) | |
set_cols_dtype (self, array) | |
set_cols_width (self, array) | |
set_precision (self, width) | |
header (self, array) | |
add_row (self, array) | |
add_rows (self, rows, header=True) | |
draw (self) | |
Public Attributes | |
str | _rows = "" |
int | _rows = 1 |
Static Public Attributes | |
int | BORDER = 1 |
int | HEADER = 1 << 1 |
int | HLINES = 1 << 2 |
int | VLINES = 1 << 3 |
Protected Member Functions | |
_str (self, i, x) | |
_check_row_size (self, array) | |
_has_vlines (self) | |
_has_hlines (self) | |
_has_border (self) | |
_has_header (self) | |
_hline_header (self) | |
_hline (self) | |
_build_hline (self, is_header=False) | |
_len_cell (self, cell) | |
_compute_cols_width (self) | |
_check_align (self) | |
_draw_line (self, line, isheader=False) | |
_splitit (self, line, isheader) | |
Protected Attributes | |
_max_width = max_width | |
int | _precision = 3 |
int | _deco |
_hline_string = None | |
_row_size = None | |
list | _header = [] |
list | _rows = [] |
_char_horiz | |
_char_vert | |
_char_corner | |
_char_header | |
list | _align = array |
list | _valign = array |
list | _dtype = array |
_width = array | |
Definition at line 149 of file click_texttable.py.
afc.click_texttable.Texttable.__init__ | ( | self, | |
max_width = 80 ) |
Constructor - max_width is an integer, specifying the maximum width of the table - if set to 0, size is unlimited, therefore cells won't be wrapped
Definition at line 156 of file click_texttable.py.
|
protected |
Return a string used to separated rows or separate header from rows
Definition at line 462 of file click_texttable.py.
|
protected |
Check if alignment has been specified, set default one if not
Definition at line 576 of file click_texttable.py.
|
protected |
Check that the specified array fits the previous rows size
Definition at line 414 of file click_texttable.py.
|
protected |
Return an array with the width of each column If a specific width has been specified, exit. If the total of the columns width exceed the table desired width, another width will be computed to fit, and cells will be wrapped.
Definition at line 503 of file click_texttable.py.
|
protected |
Draw a line Loop over a single cell length, over all the cells
Definition at line 585 of file click_texttable.py.
|
protected |
Return a boolean, if border is required or not
Definition at line 436 of file click_texttable.py.
|
protected |
Return a boolean, if header line is required or not
Definition at line 442 of file click_texttable.py.
|
protected |
Return a boolean, if hlines are required or not
Definition at line 430 of file click_texttable.py.
|
protected |
Return a boolean, if vlines are required or not
Definition at line 424 of file click_texttable.py.
|
protected |
Print an horizontal line
Definition at line 454 of file click_texttable.py.
|
protected |
Print header's horizontal line
Definition at line 448 of file click_texttable.py.
|
protected |
Return the width of the cell Special characters are taken into account to return the width of the cell, such like newlines and tabs
Definition at line 482 of file click_texttable.py.
|
protected |
Split each element of line to fit the column width Each element is turned into a list, result of the wrapping of the string to the desired width
Definition at line 617 of file click_texttable.py.
|
protected |
Handles string formatting of cell data i - index of the cell datatype in self._dtype x - cell data to format
Definition at line 366 of file click_texttable.py.
afc.click_texttable.Texttable.add_row | ( | self, | |
array ) |
Add a row in the rows stack - cells can contain newlines and tabs
Definition at line 302 of file click_texttable.py.
afc.click_texttable.Texttable.add_rows | ( | self, | |
rows, | |||
header = True ) |
Add several rows in the rows stack - The 'rows' argument can be either an iterator returning arrays, or a by-dimensional array - 'header' specifies if the first row should be used as the header of the table
Definition at line 318 of file click_texttable.py.
afc.click_texttable.Texttable.draw | ( | self | ) |
Draw the table - the table is returned as a whole string
Definition at line 339 of file click_texttable.py.
afc.click_texttable.Texttable.header | ( | self, | |
array ) |
Specify the header of the table
Definition at line 295 of file click_texttable.py.
afc.click_texttable.Texttable.reset | ( | self | ) |
Reset the instance - reset rows and header
Definition at line 173 of file click_texttable.py.
afc.click_texttable.Texttable.set_chars | ( | self, | |
array ) |
Set the characters used to draw lines between rows and columns - the array should contain 4 fields: [horizontal, vertical, corner, header] - default is set to: ['-', '|', '+', '=']
Definition at line 184 of file click_texttable.py.
afc.click_texttable.Texttable.set_cols_align | ( | self, | |
array ) |
Set the desired columns alignment - the elements of the array should be either "l", "c" or "r": * "l": column flushed left * "c": column centered * "r": column flushed right
Definition at line 221 of file click_texttable.py.
afc.click_texttable.Texttable.set_cols_dtype | ( | self, | |
array ) |
Set the desired columns datatype for the cols. - the elements of the array should be either "a", "t", "f", "e" or "i": * "a": automatic (try to use the most appropriate datatype) * "t": treat as text * "f": treat as float in decimal format * "e": treat as float in exponential format * "i": treat as int - by default, automatic datatyping is used for each column
Definition at line 247 of file click_texttable.py.
afc.click_texttable.Texttable.set_cols_valign | ( | self, | |
array ) |
Set the desired columns vertical alignment - the elements of the array should be either "t", "m" or "b": * "t": column aligned on the top of the cell * "m": column aligned on the middle of the cell * "b": column aligned on the bottom of the cell
Definition at line 234 of file click_texttable.py.
afc.click_texttable.Texttable.set_cols_width | ( | self, | |
array ) |
Set the desired columns width - the elements of the array should be integers, specifying the width of each column. For example: [10, 20, 5]
Definition at line 264 of file click_texttable.py.
afc.click_texttable.Texttable.set_deco | ( | self, | |
deco ) |
Set the table decoration - 'deco' can be a combinaison of: Texttable.BORDER: Border around the table Texttable.HEADER: Horizontal line below the header Texttable.HLINES: Horizontal lines between rows Texttable.VLINES: Vertical lines between columns All of them are enabled by default - example: Texttable.BORDER | Texttable.HEADER
Definition at line 202 of file click_texttable.py.
afc.click_texttable.Texttable.set_precision | ( | self, | |
width ) |
Set the desired precision for float/exponential formats - width must be an integer >= 0 - default value is set to 3
Definition at line 283 of file click_texttable.py.
|
protected |
Definition at line 232 of file click_texttable.py.
|
protected |
Definition at line 200 of file click_texttable.py.
|
protected |
Definition at line 200 of file click_texttable.py.
|
protected |
Definition at line 199 of file click_texttable.py.
|
protected |
Definition at line 199 of file click_texttable.py.
|
protected |
Definition at line 168 of file click_texttable.py.
|
protected |
Definition at line 262 of file click_texttable.py.
|
protected |
Definition at line 181 of file click_texttable.py.
|
protected |
Definition at line 179 of file click_texttable.py.
|
protected |
Definition at line 165 of file click_texttable.py.
|
protected |
Definition at line 166 of file click_texttable.py.
|
protected |
Definition at line 180 of file click_texttable.py.
|
protected |
Definition at line 182 of file click_texttable.py.
str afc.click_texttable.Texttable._rows = "" |
Definition at line 345 of file click_texttable.py.
int afc.click_texttable.Texttable._rows = 1 |
Definition at line 357 of file click_texttable.py.
|
protected |
Definition at line 245 of file click_texttable.py.
|
protected |
Definition at line 281 of file click_texttable.py.
|
static |
Definition at line 151 of file click_texttable.py.
|
static |
Definition at line 152 of file click_texttable.py.
|
static |
Definition at line 153 of file click_texttable.py.
|
static |
Definition at line 154 of file click_texttable.py.