Functions | Variables
rtctree.utils Namespace Reference

Functions

def build_attr_string (attrs, supported=True)
 
def colour_supported (term)
 
def dict_to_nvlist (dict)
 
def filtered (path, filter)
 
def get_num_columns_and_rows (widths, gap_width, term_width)
 
def get_terminal_size ()
 
def nvlist_to_dict (nvlist)
 
def trim_filter (filter, levels=1)
 

Variables

dictionary term_attributes
 API functions. More...
 

Function Documentation

def rtctree.utils.build_attr_string (   attrs,
  supported = True 
)
Build a string that will turn any ANSI shell output the desired
colour.

attrs should be a list of keys into the term_attributes table.

Definition at line 62 of file utils.py.

def rtctree.utils.colour_supported (   term)

Definition at line 79 of file utils.py.

def rtctree.utils.dict_to_nvlist (   dict)
Convert a dictionary into a CORBA namevalue list.

Definition at line 161 of file utils.py.

def rtctree.utils.filtered (   path,
  filter 
)
Check if a path is removed by a filter.

Check if a path is in the provided set of paths, @ref filter. If
none of the paths in filter begin with @ref path, then True is
returned to indicate that the path is filtered out. If @ref path is
longer than the filter, and starts with the filter, it is
considered unfiltered (all paths below a filter are unfiltered).

An empty filter ([]) is treated as not filtering any.

Definition at line 177 of file utils.py.

def rtctree.utils.get_num_columns_and_rows (   widths,
  gap_width,
  term_width 
)
Given a list of string widths, a width of the minimum gap to place
between them, and the maximum width of the output (such as a terminal
width), calculate the number of columns and rows, and the width of each
column, for the optimal layout.

Definition at line 85 of file utils.py.

def rtctree.utils.get_terminal_size ( )
Finds the width of the terminal, or returns a suitable default value.

Definition at line 126 of file utils.py.

def rtctree.utils.nvlist_to_dict (   nvlist)
Convert a CORBA namevalue list into a dictionary.

Definition at line 169 of file utils.py.

def rtctree.utils.trim_filter (   filter,
  levels = 1 
)
Trim @ref levels levels from the front of each path in @filter.

Definition at line 201 of file utils.py.

Variable Documentation

dictionary rtctree.utils.term_attributes
Initial value:
1 = {'reset': '00',
2  'bold': '01',
3  'faint': '02',
4  'underline': '04',
5  'blink': '05',
6  'blinkfast': '06',
7  'negative': '07',
8  'normal': '22',
9  'nounderline': '24',
10  'noblink': '25',
11  'positive': '27',
12  'black': '30',
13  'red': '31',
14  'green': '32',
15  'brown': '33',
16  'blue': '34',
17  'purple': '35',
18  'cyan': '36',
19  'white': '37',
20  'bgblack': '40',
21  'bgred': '41',
22  'bggreen': '42',
23  'bgbrown': '43',
24  'bgblue': '44',
25  'bgpurple': '45',
26  'bgcyan': '46',
27  'bgwhite': '47',
28  }

API functions.

Definition at line 31 of file utils.py.



rtctree
Author(s): Geoffrey Biggs
autogenerated on Fri Jun 7 2019 21:56:24