base module

class gensei.base.Config(**kwargs)
static from_conf(conf, required, optional)
static from_file(filename, required, optional)
override(options, can_override)
class gensei.base.Object(**kwargs)
copy(deep=False)
fd_close()
fd_open(filename)
get_dict()
init_trait(name, value, format=None)
static objects_from_dict(*args, **kwargs)
report(filename, header=True)
set_default_traits(keys)
class gensei.base.Output(prefix, filename=None, combined=False, **kwargs)

Factory class providing output (print) functions.

Example:

>>> output = Output( 'sfepy:' )
>>> output( 1, 2, 3, 'hello' )
>>> output.prefix = 'my_cool_app:'
>>> output( 1, 2, 3, 'hello' )

Methods

copy
fd_close
fd_open
get_dict
get_output_function
get_output_prefix
init_trait
objects_from_dict
report
set_default_traits
set_output
set_output_prefix
get_output_function()
get_output_prefix()
prefix
set_output(filename=None, combined=False, append=False)

Set the output function - all SfePy printing is accomplished by it. If filename is None, output is to screen only, otherwise it is to the specified file, moreover, if combined is True, both the ways are used.

Arguments:
filename - print into this file combined - print both on screen and into a file append - append to an existing file instead of overwriting it
set_output_prefix(prefix)
gensei.base.assert_(condition)
gensei.base.dict_from_keys_init(keys, seq_class=None)
gensei.base.import_file(filename, package_name=None)
Import a file as a module. The module is explicitly reloaded to prevent undesirable interactions.
gensei.base.is_sequence(obj)
gensei.base.ordered_iteritems(adict)
gensei.base.pause(msg=None)

Prints the line number and waits for a keypress.

If you press: “q” ............. it will call sys.exit() any other key ... it will continue execution of the program

This is useful for debugging.

gensei.base.spause(msg=None)

Waits for a keypress.

If you press: “q” ............. it will call sys.exit() any other key ... it will continue execution of the program

This is useful for debugging. This function is called from pause().

This Page