def readHintSection(xmlCtx, section, flags): sectionInfo = sub_parsers.parseHint(xmlCtx, section) hint = chapter.ChainHint(sectionInfo['hintID'], sectionInfo['itemID'], sectionInfo['text'], sectionInfo['hasBox'], sectionInfo['arrow'], sectionInfo['padding']) hint.setActions( sub_parsers.parseActions( xmlCtx, _xml.getSubsection(xmlCtx, section, 'actions'), flags)) return hint
def parse(filePath, excludedHints): hints = HintsData() section = ResMgr.openSection(filePath) if section is None: _xml.raiseWrongXml(None, filePath, 'can not open or read') xmlCtx = (None, filePath) hints.setGuiFilePath(_xml.readString(xmlCtx, section, 'gui')) for _, subSec in _xml.getChildren(xmlCtx, section, 'hints'): hint = sub_parsers.parseHint(xmlCtx, subSec) if hint['hintID'] not in excludedHints: hints.addHint(hint) return hints
def readHintSection(xmlCtx, section, flags): sectionInfo = sub_parsers.parseHint(xmlCtx, section) hint = chapter.ChainHint(sectionInfo['hintID'], sectionInfo['itemID'], sectionInfo['text'], sectionInfo['hasBox'], sectionInfo['arrow'], sectionInfo['padding']) hint.setActions(sub_parsers.parseActions(xmlCtx, _xml.getSubsection(xmlCtx, section, 'actions'), flags)) return hint