本文整理汇总了Python中tutorial.doc_loader.sub_parsers.parseID函数的典型用法代码示例。如果您正苦于以下问题:Python parseID函数的具体用法?Python parseID怎么用?Python parseID使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了parseID函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: _readHintSection
def _readHintSection(xmlCtx, section, flags):
hintID = sub_parsers.parseID(xmlCtx, section, 'Specify a hint ID')
if 'item-id' in section.keys():
itemID = sub_parsers.parseID(xmlCtx, section['item-id'], 'Specify a item ID')
else:
_xml.raiseWrongXml(xmlCtx, section.name, 'Specify a item ID')
return
tags = section.keys()
text = translation(_xml.readString(xmlCtx, section, 'text'))
if 'arrow' in tags:
subSec = section['arrow']
direction = _xml.readString(xmlCtx, subSec, 'direction')
if direction not in _AVAILABLE_DIRECTIONS:
_xml.raiseWrongXml(xmlCtx, section, 'Arrow direction {} is invalid.'.format(direction))
arrow = _ArrowProps(direction, _xml.readBool(xmlCtx, subSec, 'loop'))
else:
arrow = None
if 'padding' in tags:
subSec = section['padding']
padding = _Padding(_xml.readFloat(xmlCtx, subSec, 'left'), _xml.readFloat(xmlCtx, subSec, 'top'), _xml.readFloat(xmlCtx, subSec, 'right'), _xml.readFloat(xmlCtx, subSec, 'bottom'))
else:
padding = None
hint = chapter.ChainHint(hintID, itemID, text, section.readBool('has-box', True), arrow, padding)
hint.setActions(sub_parsers.parseActions(xmlCtx, _xml.getSubsection(xmlCtx, section, 'actions'), flags))
return hint
开发者ID:webiumsk,项目名称:WOT-0.9.12-CT,代码行数:25,代码来源:chains.py
示例2: _readProgressSection
def _readProgressSection(xmlCtx, section, _):
progressID = sub_parsers.parseID(xmlCtx, section, 'Specify a progress ID')
conditions = []
for _, subSec in _xml.getChildren(xmlCtx, section, 'steps'):
conditions.append(chapter.HasIDConditions(sub_parsers.parseID(xmlCtx, subSec, 'Specify a condition ID'), sub_parsers.readConditions(xmlCtx, subSec, [])))
return chapter.ChapterProgress(progressID, conditions)
开发者ID:webiumsk,项目名称:WOT0.9.10,代码行数:7,代码来源:battle.py
示例3: _readChapterTaskSection
def _readChapterTaskSection(xmlCtx, section, _):
taskID = sub_parsers.parseID(xmlCtx, section, 'Specify a task ID')
text = translation(_xml.readString(xmlCtx, section, 'text'))
flagID = None
if 'flag' in section.keys():
flagID = _xml.readString(xmlCtx, section, 'flag')
return chapter.ChapterTask(taskID, text, flagID=flagID)
开发者ID:webiumsk,项目名称:WOT0.9.10,代码行数:7,代码来源:battle.py
示例4: _parseScenes
def _parseScenes(self, xmlCtx, section, chapter, flags, itemFlags, afterBattle, initial):
for _, sceneSec in _xml.getChildren(xmlCtx, section, 'scenes'):
sceneID = sub_parsers.parseID(xmlCtx, sceneSec, 'Specify a unique name for the scene')
scene = Scene(entityID=sceneID)
self._parseScene(xmlCtx, sceneSec, scene, flags, itemFlags, afterBattle=afterBattle)
self._parseSharedScene(chapter, scene, flags, itemFlags)
chapter.addScene(scene)
开发者ID:webiumsk,项目名称:WOT0.9.10,代码行数:7,代码来源:quests.py
示例5: _readGreetingSection
def _readGreetingSection(xmlCtx, section, _):
greetingID = sub_parsers.parseID(xmlCtx, section, 'Specify a greeting ID')
title = translation(_xml.readString(xmlCtx, section, 'title'))
text = translation(_xml.readString(xmlCtx, section, 'text'))
speakID = None
if 'speak' in section.keys():
speakID = _xml.readString(xmlCtx, section, 'speak')
return chapter.Greeting(greetingID, title, text, speakID=speakID)
开发者ID:webiumsk,项目名称:WOT0.9.10,代码行数:8,代码来源:battle.py
示例6: _readMarkerSection
def _readMarkerSection(xmlCtx, section, _):
markerID = sub_parsers.parseID(xmlCtx, section, 'Specify a marker ID')
type = _xml.readString(xmlCtx, section, 'type')
marker = None
if type in _MARKER_TYPES:
parser = _MARKER_TYPES[type]
marker = parser(xmlCtx, section, markerID, _xml.readString(xmlCtx, section, 'var-ref'))
else:
LOG_ERROR('Marker is not supported:', type)
return marker
开发者ID:webiumsk,项目名称:WOT0.9.10,代码行数:10,代码来源:battle.py
示例7: _readImageSection
def _readImageSection(xmlCtx, section, _):
imageID = sub_parsers.parseID(xmlCtx, section, 'Specify a image ID')
imageType = _xml.readString(xmlCtx, section, 'type')
image = None
if imageType in _IMAGE_TYPES:
parser = _IMAGE_TYPES[imageType]
image = parser(xmlCtx, section, imageID)
else:
LOG_ERROR('Image is not supported:', imageType)
return image
开发者ID:webiumsk,项目名称:WOT0.9.10,代码行数:10,代码来源:battle.py
示例8: parse
def parse(self):
section = ResMgr.openSection(BONUSES_REFS_FILE_PATH)
if section is None:
_xml.raiseWrongXml(None, BONUSES_REFS_FILE_PATH, 'can not open or read')
xmlCtx = (None, BONUSES_REFS_FILE_PATH)
result = {}
for _, subSec in _xml.getChildren(xmlCtx, section, 'bonuses'):
bonusID = sub_parsers.parseID(xmlCtx, subSec, 'Specify a bonus ID')
result[bonusID] = Bonus(subSec.readInt('id', -1), subSec.readString('message'), sub_parsers.readValues(subSec))
return result
开发者ID:webiumsk,项目名称:WOT-0.9.12,代码行数:11,代码来源:__init__.py
示例9: _parseVars
def _parseVars(self, xmlCtx, section, flags, chapter):
gVarIDs = []
for name, subSec in _xml.getChildren(xmlCtx, section, 'vars'):
if name == 'var-set':
chapter.addVarSet(sub_parsers.parseVarSet(xmlCtx, subSec, flags))
elif name == 'var-set-ref':
gVarIDs.append(sub_parsers.parseID(xmlCtx, subSec, 'Specify a var ID'))
else:
_xml.raiseWrongXml(xmlCtx, name, 'Unknown tag')
if gVarIDs:
GlobalRefParser().parse(chapter, varIDs=gVarIDs, flags=flags)
开发者ID:webiumsk,项目名称:WOT-0.9.12,代码行数:12,代码来源:__init__.py
示例10: _parseBonus
def _parseBonus(self, xmlCtx, section, bonuses):
tags = section.keys()
if 'bonus' in tags:
subSection = section['bonus']
return Bonus(subSection.readInt('id', -1), subSection.readString('message'), sub_parsers.readValues(subSection))
if 'bonus-ref' in tags:
bonusID = sub_parsers.parseID(xmlCtx, section['bonus-ref'], 'Specify a bonus ID')
if bonusID in bonuses:
return bonuses[bonusID]
_xml.raiseWrongXml(xmlCtx, section.name, 'Bonus reference {0} is not found'.format(bonusID))
else:
_xml.raiseWrongXml(xmlCtx, section.name, 'Bonuses is not found')
开发者ID:webiumsk,项目名称:WOT-0.9.12,代码行数:12,代码来源:__init__.py
示例11: _readHintSection
def _readHintSection(xmlCtx, section, _):
hintID = sub_parsers.parseID(xmlCtx, section, 'Specify a hint ID')
text = translation(_xml.readString(xmlCtx, section, 'text'))
if 'image' in section.keys():
image = chapter.SimpleImagePath(None, _xml.readString(xmlCtx, section, 'image'))
elif 'image-ref' in section.keys():
image = _xml.readString(xmlCtx, section, 'image-ref')
else:
image = chapter.SimpleImagePath()
speakID = None
if 'speak' in section.keys():
speakID = _xml.readString(xmlCtx, section, 'speak')
return chapter.SimpleHint(hintID, text, image, speakID=speakID)
开发者ID:webiumsk,项目名称:WOT0.9.10,代码行数:13,代码来源:battle.py
示例12: readTutorialSettingSection
def readTutorialSettingSection(xmlCtx, section, flags):
settingID = sub_parsers.parseID(xmlCtx, section, 'Specify a setting ID')
settingName = None
if 'setting-name' in section.keys():
settingName = _xml.readString(xmlCtx, section, 'setting-name')
else:
_xml.raiseWrongXml(xmlCtx, section.name, 'Specify a setting name')
settingValue = None
if 'setting-value' in section.keys():
settingValue = _xml.readBool(xmlCtx, section, 'setting-value')
else:
_xml.raiseWrongXml(xmlCtx, section.name, 'Specify a setting value')
return chapter.TutorialSetting(settingID, settingName, settingValue)
开发者ID:kblw,项目名称:wot_client,代码行数:13,代码来源:quests.py
示例13: parse
def parse(self, chapter, varIDs = None, flags = None):
if varIDs is None:
varIDs = []
if flags is None:
flags = []
section = ResMgr.openSection(GLOBAL_REFS_FILE_PATH)
if section is None:
_xml.raiseWrongXml(None, GLOBAL_REFS_FILE_PATH, 'can not open or read')
xmlCtx = (None, GLOBAL_REFS_FILE_PATH)
if len(varIDs):
for _, subSec in _xml.getChildren(xmlCtx, section, 'vars'):
varID = sub_parsers.parseID(xmlCtx, subSec, 'Specify a var ID')
if varID in varIDs:
chapter.addVarSet(sub_parsers.parseVarSet(xmlCtx, subSec, flags))
开发者ID:kblw,项目名称:wot_client,代码行数:14,代码来源:__init__.py
示例14: readSaveAccountSettingSection
def readSaveAccountSettingSection(xmlCtx, section, _, conditions):
settingID = sub_parsers.parseID(xmlCtx, section, 'Specify a setting ID')
return effects.HasTargetEffect(settingID, _EFFECT_TYPE.SAVE_ACCOUNT_SETTING, conditions=conditions)
开发者ID:kblw,项目名称:wot_client,代码行数:3,代码来源:quests.py
示例15: _readInternalBrowserSection
def _readInternalBrowserSection(xmlCtx, section, flags, conditions):
flagID = sub_parsers.parseID(xmlCtx, section, 'Specify a flag ID')
if flagID not in flags:
flags.append(flagID)
return effects.HasTargetEffect(flagID, _EFFECT_TYPE.OPEN_INTERNAL_BROWSER, conditions=conditions)
开发者ID:kblw,项目名称:wot_client,代码行数:5,代码来源:offbattle.py
示例16: readSaveTutorialSettingSection
def readSaveTutorialSettingSection(xmlCtx, section, _, conditions):
settingID = sub_parsers.parseID(xmlCtx, section, 'Specify a setting ID')
return effects.HasTargetEffect(settingID, _EFFECT_TYPE.SAVE_TUTORIAL_SETTING, conditions=conditions)
开发者ID:kblw,项目名称:wot_client,代码行数:3,代码来源:quests.py
示例17: _readRemoveMarkerSection
def _readRemoveMarkerSection(xmlCtx, section, _, conditions):
markerID = sub_parsers.parseID(xmlCtx, section, 'Specify a marker ID')
return effects.HasTargetEffect(markerID, _EFFECT_TYPE.REMOVE_MARKER, conditions=conditions)
开发者ID:webiumsk,项目名称:WOT0.9.10,代码行数:3,代码来源:battle.py
示例18: _readExitQueueEffectSection
def _readExitQueueEffectSection(xmlCtx, section, flags, conditions):
flagID = sub_parsers.parseID(xmlCtx, section, 'Specify a flag ID')
if flagID not in flags:
flags.append(flagID)
return effects.HasTargetEffect(flagID, _EFFECT_TYPE.EXIT_QUEUE, conditions=conditions)
开发者ID:kblw,项目名称:wot_client,代码行数:5,代码来源:offbattle.py
示例19: _readNextTaskSection
def _readNextTaskSection(xmlCtx, section, _, conditions):
taskID = sub_parsers.parseID(xmlCtx, section, 'Specify a next task ID')
return effects.HasTargetEffect(taskID, _EFFECT_TYPE.NEXT_TASK, conditions=conditions)
开发者ID:webiumsk,项目名称:WOT0.9.10,代码行数:3,代码来源:battle.py
示例20: _readExitSection
def _readExitSection(xmlCtx, section, _):
exitID = sub_parsers.parseID(xmlCtx, section, 'Specify a exit ID')
return chapter.Exit(exitID, nextChapter=_xml.readString(xmlCtx, section, 'chapter-id'), nextDelay=_xml.readFloat(xmlCtx, section, 'next-delay'), finishDelay=section.readFloat('finish-delay'), isSpeakOver=section.readBool('is-speak-over'))
开发者ID:webiumsk,项目名称:WOT0.9.10,代码行数:3,代码来源:battle.py
注:本文中的tutorial.doc_loader.sub_parsers.parseID函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论