BlockIt
blockit::funcs Namespace Reference

Functions

def indent
def indentNoStrip
def And
def Or
def Not
def startsWith
def endsWith
def genBlockGraph
def depGraph
def topoSort

Variables

list __all__
tuple pack = lambdax:x.strip()
tuple tab = lambdax:len(x)
tuple isLeaf = lambda(x,v)

Function Documentation

def blockit::funcs::And (   f1,
  f2 
)

Definition at line 59 of file funcs.py.

def blockit::funcs::depGraph (   blocks,
  table,
  silent = True 
)
Generate dependency graph which is simply a dictionary where each entry is
the node name and contains a list of sets.  The first set is the nodes
connected to incoming edges, the second set is the nodes connected to
outgoing edges.  The graph is generated for the dependencies of the types
in the block list.  For example, if the list of blocks are of type AFile,
then the dependencies found are between AFiles; if modules, then modules,
etc...  Use the output of this function with topoSort() to get an
non-unique ordering of dependencies.

Input
-----
blocks : list of blocks to find the build order for
table : global symbol table to use

Definition at line 121 of file funcs.py.

def blockit::funcs::endsWith (   s)

Definition at line 78 of file funcs.py.

def blockit::funcs::genBlockGraph (   blk)
Generate a graphviz graph of the given block and return it.

blk : a Block instance

Definition at line 84 of file funcs.py.

def blockit::funcs::indent (   nspaces,
  s 
)
Function padding a string with leading spaces.  Existing leading spaces
of string are removed prior to padding.

Definition at line 41 of file funcs.py.

def blockit::funcs::indentNoStrip (   nspaces,
  s 
)
Function padding a string with leading spaces.

Definition at line 48 of file funcs.py.

def blockit::funcs::Not (   f1)

Definition at line 67 of file funcs.py.

def blockit::funcs::Or (   f1,
  f2 
)

Definition at line 63 of file funcs.py.

def blockit::funcs::startsWith (   s)

Definition at line 75 of file funcs.py.

def blockit::funcs::topoSort (   diGraph,
  prune = True 
)
Topological sort of a given diGraph.  The diGraph is represented as a
dictionary whose keys are the node names and each key entry contains a
2-tuple of lists/sets.  The first is the keys of nodes connected on
incoming edges, the second is the keys of nodes connected on outgoing
edges.

Example:
-------
{'node1':(['a','b','c'],['r','s','t']}

means 'node1' has nodes ['a','b','c','d'] connected on 'incoming' edges,
i.e. 'node1' depends on these nodes.  Likewise, nodes ['r','s','t'] are
dependent on 'node1' because they are connected on 'outgoing' edges.

Input
-----
diGraph : the diGraph
prune : boolean flag to prune isolated nodes from the list

Definition at line 196 of file funcs.py.


Variable Documentation

Initial value:
00001 ['pack',
00002          'tab',
00003          'indent', 'indentNoStrip',
00004          'And', 'Or', 'Not', 'isLeaf', 'startsWith', 'endsWith',
00005          'genBlockGraph',
00006          'depGraph',
00007          'topoSort']

Definition at line 18 of file funcs.py.

tuple blockit::funcs::isLeaf = lambda(x,v)

Definition at line 73 of file funcs.py.

tuple blockit::funcs::pack = lambdax:x.strip()

Definition at line 35 of file funcs.py.

tuple blockit::funcs::tab = lambdax:len(x)

Definition at line 38 of file funcs.py.

 All Classes Namespaces Files Functions Variables Properties