How to use the texttable.Texttable.BORDER function in texttable

To help you get started, we’ve selected a few texttable examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github foutaise / texttable / tests.py View on Github external
def test_chaining():
    table = Texttable()
    table.reset()
    table.set_max_width(50)
    table.set_chars(list('-|+='))
    table.set_deco(Texttable.BORDER)
    table.set_header_align(list('lll'))
    table.set_cols_align(list('lll'))
    table.set_cols_valign(list('mmm'))
    table.set_cols_dtype(list('ttt'))
    table.set_cols_width([3, 3, 3])
    table.set_precision(3)
    table.header(list('abc'))
    table.add_row(list('def'))
    table.add_rows([list('ghi')], False)
    s1 = table.draw()
    s2 = (Texttable()
          .reset()
          .set_max_width(50)
          .set_chars(list('-|+='))
          .set_deco(Texttable.BORDER)
          .set_header_align(list('lll'))
github theserverlessway / formica / formica / stack_waiter.py View on Github external
def print_header(self):
        if self.timeout > 0:
            logger.info("Timeout set to {} minute(s)".format(self.timeout))
        table = self.__create_table()
        table.add_rows([EVENT_TABLE_HEADERS])
        table.set_deco(Texttable.BORDER | Texttable.VLINES)
        logger.info(table.draw())
github VainlyStrain / Vaile / core / methods / select.py View on Github external
def display(i, names: list, descriptions: list, values: list):
    for k in i:
        names.append(k)
        descriptions.append(i[k][0])
        values.append(i[k][1])

    t = table.Texttable()
    headings = ["Name", "Desc.", "Val"]
    t.header(headings)
    #t.set_chars(["-"," ","+","~"])
    t.set_deco(table.Texttable.BORDER)
    for row in zip(names, descriptions, values):
        t.add_row(row)
    s = t.draw()
    print(s + "\n")
    return names, descriptions, values
github p768lwy3 / torecsys / torecsys / data / dataloader / collate_fn.py View on Github external
def summary(self,
                deco        : int = Texttable.BORDER,
                cols_align  : List[str] = ["l", "l", "l"],
                cols_valign : List[str] = ["t", "t", "t"]) -> TypeVar("DataloaderCollator"):
        r"""Get summary of trainer.

        Args:
            deco (int): Border of texttable
            cols_align (List[str]): List of string of columns' align
            cols_valign (List[str]): List of string of columns' valign
        
        Returns:
            torecsys.data.dataloader.DataloaderCollator: self
        """
         # Create and configurate Texttable
        t = Texttable()
        t.set_deco(deco)
        t.set_cols_align(cols_align)
github p768lwy3 / torecsys / torecsys / trainer / trainer.py View on Github external
#. data per hyperparameter (e.g. dropout size, hidden size)

        #. training loss per epochs

        #. metrics, including AUC, logloss

        #. matplotlib line chart of data
        
        Returns:
            str: string of result of texttable.draw
        """
        raise NotImplementedError("not implemented.")

        # initialize and configurate Texttable
        t = Texttable()
        t.set_deco(Texttable.BORDER)
        t.set_cols_align(["l", "l"])
        t.set_cols_valign(["t", "t"])

        # append data to texttable

        return t.draw()
github raydouglass / media_management_scripts / media_management_scripts / commands / __init__.py View on Github external
def _bulk(self, files: List[Tuple[str, ...]], op: Callable[[str, str], None],
              column_descriptions: List[str] = [], src_index=0, dest_index=1, print_table=True):
        from texttable import Texttable
        if not print_table and self.dry_run:
            return
        if print_table:
            table = [column_descriptions]
            table.extend(files)
            t = Texttable(max_width=0)
            t.set_deco(Texttable.VLINES | Texttable.HEADER | Texttable.BORDER)
            t.add_rows(table)
            print(t.draw())
        if not self.dry_run:
            for file_tuple in files:
                src = file_tuple[src_index]
                dst = file_tuple[dest_index]
                if src and dst:
                    op(src, dst)
github quentinhardy / odat / texttable.py View on Github external
def _has_border(self):
        """Return a boolean, if border is required or not
        """

        return self._deco & Texttable.BORDER > 0
github p768lwy3 / torecsys / torecsys / trainer / trainer.py View on Github external
def summary(self,                
                deco        : int = Texttable.BORDER,
                cols_align  : List[str] = ["l", "l"],
                cols_valign : List[str] = ["t", "t"]) -> TypeVar("Trainer"):
        r"""Get summary of trainer.

        Args:
            deco (int): Border of texttable
            cols_align (List[str]): List of string of columns' align
            cols_valign (List[str]): List of string of columns' valign
        
        Returns:
            torecsys.trainer.Trainer: self
        """
        # Get attributes from self and initialize _vars of parameters 
        _vars = {
            "objective"     : self._objective,
            "inputs"        : self._inputs.__class__.__name__ if self.has_inputs else None,