This is the python port of genericore, the generic information gathering framework.
The python-genericore and it's submodules are currently under HEAVY development and may suck balls in the current state. I appologize for that.
Currently the python implementation has the following submodules
- utils.py - a number of functions which define "common patterns" in all
genericore plugins (e.g. commandline parser or unique-id generator)
- parse_default (argparse ) : adds default parser parameters
- generate_unique (VERSION, config) : generates a unique id from the Version number of the script and the configuration given
auto_amqp.py - the amqp connector class which provides the following functions:
load_conf(dict) - loads and merges configuration from the given dictionary
load_conf_file(fname) - loads and merges configuration directly from a file
create_connection() - starts the connection the the AMQP Server
[internal] _setup_tubes() - creates the in 'config' configured input and output queues/exchanges. will be called by create_connection in addition it registers the following functions if input exchange is defined:
- consume (callback) - calls amqp's basic_consume with the correct params
- start_loop () - calls asyncore_loop() the following function is registered if the output exchange is defined
- publish (msg) - sends a message to the output exchange
close_connection () - closes all connections, cleans up the object In addition to that, auto_amqp.py needs to hold a "default parameter" list called DEFAULT_CONFIG.
python-genericore provides a extensive configuration submodule whichs allows the modules to evaluate/mix and merge configuration files.
The class Configurable provides a basic functionality to load configuration into the variable config via load_conf. this can be used to merge two configurations.
In addition to that there is a Configurator class which provides basic functionality for parsing defaults. please see main.py of mail_proc how to use these two.