============
rules_config
============

This module implent a system for take back the rules chains from a
configuration file.

RulesInit
---------

This class will load and chain the rules::

    >>> from ecs.cart.rules.rules_config import RulesInit
    >>> rules = RulesInit()
    >>> 'amount' in rules.chain.keys()
    True

If you want load and chain specific rules you can configure it into a cfg file
and init the rules with it.

This is an exemple for a cfg files::
    
    [main]
    connector = "test"

    [rules]
    mychain = ecs.cart.rules.standard_rules.CartAmount
	      ecs.cart.rules.standard_rules.ObjectAmount

    myotherchain = ecs.cart.rules.standard_rules.CartAmount
		   ecs.cart.rules.standard_rules.ObjectReduction
		   ecs.cart.rules.standard_rules.ObjectAmount

And load it in python::

    >>> rules = RulesInit(conf_file="./docs/source/module/etc/rules.cfg")
    >>> 'mychain' in rules.chain.keys()
    True
