Package mbuild :: Module base
[frames] | no frames]

Module base

source code

Base functionality: messages, verbosity, python version checking

Functions
string
bracket(s, m='')
add a bracket around s and append m.
source code
bool
check_python_version(maj, minor, fix=0)
Return true if the current python version at least the one specified by the arguments.
source code
 
cond_die(v, cmd, msg)
Conditionally die, if v is not zero.
source code
 
die(m, s='')
Emit an error message m (and optionally s) and exit with a return value 1
source code
 
error_msg(s, t)
Emit '[s] t' to stderr with a newline
source code
int
get_python_version()
Return the python version as an integer
source code
tuple
get_python_version_tuple()
Return the python version as a tuple (major,minor,fixlevel)
source code
 
get_verbosity()
Return the global verbosity level.
source code
 
msg(s, pad='')
Emit s to stdout with a newline
source code
 
msgb(s, t='', pad='')
a bracketed string s sent to stdout, followed by a string t
source code
 
msgn(s, pad='')
Emit s to stdout without a newline
source code
bool
on_native_windows()
Returns: True iff on native windows win32/win64
source code
bool
on_windows()
Returns: True iff on windows cygwin/win32/win64
source code
 
set_verbosity(v)
Set the global verbosity level.
source code
bool
verbose(level=0)
Return True if the configured message level supplied is >= the level arguement
source code
 
vmsgb(v, s, t='', pad='')
If verbosity v is sufficient, emit a bracketed string s sent to stdout, followed by a string t
source code
 
warn(m)
Emit an warning message
source code
Variables
  __package__ = 'mbuild'
Function Details

bracket(s, m='')

source code 

add a bracket around s and append m.

Returns: string
a bracketed string s and a suffixed message m

check_python_version(maj, minor, fix=0)

source code 

Return true if the current python version at least the one specified by the arguments.

Returns: bool
True/False

cond_die(v, cmd, msg)

source code 

Conditionally die, if v is not zero. Print the msg and the cmd.

Parameters:
  • v (int) - we die if v is not 0
  • cmd (string) - a command to print
  • msg (string) - a message to print before the command

get_python_version()

source code 

Return the python version as an integer

Returns: int
major * 100000 + minor + 1000 + fixlevel

get_python_version_tuple()

source code 

Return the python version as a tuple (major,minor,fixlevel)

Returns: tuple
(major,minor,fixlevel)

get_verbosity()

source code 

Return the global verbosity level. 0=quiet, 99=very very noisy

on_native_windows()

source code 
Returns: bool
True iff on native windows win32/win64

on_windows()

source code 
Returns: bool
True iff on windows cygwin/win32/win64

set_verbosity(v)

source code 

Set the global verbosity level. 0=quiet, 99=very very noisy

verbose(level=0)

source code 

Return True if the configured message level supplied is >= the level arguement

Parameters:
  • level - int
  • level - the verbosity level at which this function should return True
Returns: bool
True iff the level argument is >= current verbosity level