Ejemplo n.º 1
0
def _readHintSection(xmlCtx, section, _):
    hintID = sub_parsers._parseID(xmlCtx, section, 'Specify a hint ID')
    text = translation(_xml.readString(xmlCtx, section, 'text'))
    image = None
    if 'image' in section.keys():
        image = _xml.readString(xmlCtx, section, 'image')
    speakID = None
    if 'speak' in section.keys():
        speakID = _xml.readString(xmlCtx, section, 'speak')
    return chapter.SimpleHint(hintID, text, image=image, speakID=speakID)
Ejemplo n.º 2
0
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 'wwspeak' in section.keys():
        speakID = _xml.readString(xmlCtx, section, 'wwspeak')
    return chapter.SimpleHint(hintID, text, image, speakID=speakID)