xoa.cfgm.filter_section
- xoa.cfgm.filter_section(sec, cfgfilter, default=False)[source]
Recursively filter a section according to a dict of specifications
When encountering an option of
sec, it removed if its value incfgfilteris set to False. When not found, it default to the__default__key ofcfgfilter. And if the__default__is not found, it defaults toFalse(filtered out). When an option is a section and its value incfgfilteris a dictionary, this subsection is filtered in the same way with the value as restrictions (cfgfilter[subsection]).- Parameters
sec – A
configobj.Sectioninstance.cfgfilter – A dictionary tree with the same structure as
sec.