taurus taurus

Previous topic

taurus.test

Next topic

taurus.web

This Page

ModuleExplorer

Inheritance diagram of ModuleExplorer

class ModuleExplorer(exclude_patterns=(), verbose=True)

Bases: object

static explore(modulename, exclude_patterns=(), verbose=True)

convenience to explore a module

Parameters:
  • modulename – the name of the module to explore
  • exclude_patterns (:class:~`seq` <:class:~`str`>) – sequence of strings containing regexp patterns. Each candidate to be explored will be matched against these patterns and will be excluded if it matches any of them.
  • verbose (:class:~`bool`) – If True (default) status messages will be printed to stdout
Return type:

:class:~`dict` <:class:~`str`, :class:~`object`>

Returns:

a tuple whose first member is a dictionary containing submodulenames, localclassnames, localfunctionnames, localenumerationnames, externalmembernames, submodules, warnings. The second member of the tuple is a list containing all the warnings accummulated.

exploreModule(modulename)

Recursive function that gathers info on a module and all its submodules.

Parameters:modulename – the name of the module to explore
Return type::class:~`dict` <:class:~`str`, :class:~`object`>
Returns:a dictionary containing submodulenames, localclassnames, localfunctionnames, localenumerationnames, externalmembernames, submodules, warnings
static getAll(info, key)

append all values for a given key in a nested “moduleinfo” dictionary

Parameters:
  • info (:class:~`dict`) – a moduleinfo dictionary like the one returned by exploreModule()
  • key (:class:~`str`) – a key of a moduleinfo dictionary
Return type:

:class:~`list` <:class:~`tuple`>

Returns:

a list that concatenates tuples where the first element is the (sub)module name and the second element is the value for the given key. If for a certain submodule, the value is empty, it is not included in the list at all.