New configuration file plan (including options for filters)
On the IRC meeting (see IrcSession20050209). it was decided that:
1. the config file will be kept in the INI format (as it is today)
2. sections will map to the cpg object hierarchy
3. attributes in the INI file will be mapped to attributes in the objects.
4. Filters will be configurable as objects in the cpg hierarchy.
5. filters will be declared in three lists:
6. The final filterList is the concatenation:
defaultInputFilterList, _cpFilterList, defaultOutputFilterList.
- Any of them can be overriden in code.
- The standard
_cpFilterListis empty, and the user can supply additional filters that will neatly fit in the middle of the chain. 7. default filters are named, using the usual Python convention. For example, the default
EncodingFiltercan be acessed as the
encodingFilter(starting with lowercase) attribute in the config file.
Config file sample
[root] encodingFilter.encoding = latin1
encodingFilteris the name of the filter;
encodingis an attribute of the
latin1is a string, it's passed to the encoding attribute.
- Values are passed as string, all type conversion is done by the attribute itself. It is still not clear if the attribute setting will be handled by a method or my a descriptor/property in the filter object.
This ticket will probably be split into a few sub-tickets, because there's a lot of changes. This ticket should only be closed when the entire task is completed. Sub-tickets should be cited here as additional comments on this ticket.
Reported by cribeiro