def _readSetFilterSection(xmlCtx, section, _, conditions): filterID = sub_parsers._parseID(xmlCtx, section, 'Specify a filter ID') value = [] for name, subSec in _xml.getChildren(xmlCtx, section, 'value'): value.append(sub_parsers._readVarValue(name, subSec)) return chapter.SetFilter(filterID, tuple(value), conditions=conditions)
def __readCommandsSection(self, xmlCtx, section): self.__commands.clear() for _, subSection in _xml.getChildren(xmlCtx, section, 'gui-commands'): commandID = sub_parsers._parseID(xmlCtx, subSection, 'Specify a command ID') cmdType = _xml.readString(xmlCtx, subSection, 'type') command = _xml.readString(xmlCtx, subSection, 'name') argsSec = _xml.getChildren(xmlCtx, subSection, 'args') args = [] for name, argSec in argsSec: args.append(sub_parsers._readVarValue(name, argSec)) self.__commands[commandID] = CommandData(cmdType, command, args)