Functions | Variables
rtctree::utils Namespace Reference

Functions

def build_attr_string
def colour_supported
def dict_to_nvlist
def filtered
def get_num_columns_and_rows
def get_terminal_size
def nvlist_to_dict
def trim_filter

Variables

dictionary term_attributes
 API functions.

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.

Definition at line 79 of file utils.py.

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.

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

Initial value:
00001 {'reset': '00',
00002                    'bold': '01',
00003                    'faint': '02',
00004                    'underline': '04',
00005                    'blink': '05',
00006                    'blinkfast': '06',
00007                    'negative': '07',
00008                    'normal': '22',
00009                    'nounderline': '24',
00010                    'noblink': '25',
00011                    'positive': '27',
00012                    'black': '30',
00013                    'red': '31',
00014                    'green': '32',
00015                    'brown': '33',
00016                    'blue': '34',
00017                    'purple': '35',
00018                    'cyan': '36',
00019                    'white': '37',
00020                    'bgblack': '40',
00021                    'bgred': '41',
00022                    'bggreen': '42',
00023                    'bgbrown': '43',
00024                    'bgblue': '44',
00025                    'bgpurple': '45',
00026                    'bgcyan': '46',
00027                    'bgwhite': '47',
00028                    }

API functions.

Definition at line 31 of file utils.py.



rtctree
Author(s): Geoffrey Biggs
autogenerated on Wed Aug 26 2015 16:13:08