示例#1
0
文件: loader.py 项目: cmpitg/qutepart
def _loadKeyword(parentContext, xmlElement, attributeToFormatMap, formatConverterFunction):
    string = _safeGetRequiredAttribute(xmlElement, 'String', None)
    try:
        words = parentContext.parser.lists[string]
    except KeyError:
        _logger.warning("List '%s' not found", string)
        
        words = list()
    
    insensitive = _parseBoolAttribute(xmlElement.attrib.get("insensitive", "false"))
    
    abstractRuleParams = _loadAbstractRuleParams(parentContext, xmlElement, attributeToFormatMap, formatConverterFunction)
    return _parserModule.keyword(abstractRuleParams, words, insensitive)
示例#2
0
def _loadKeyword(parentContext, xmlElement, attributeToFormatMap):
    string = _safeGetRequiredAttribute(xmlElement, 'String', None)
    try:
        words = parentContext.parser.lists[string]
    except KeyError:
        _logger.warning("List '%s' not found", string)

        words = list()

    insensitive = _parseBoolAttribute(
        xmlElement.attrib.get("insensitive", "false"))

    abstractRuleParams = _loadAbstractRuleParams(parentContext, xmlElement,
                                                 attributeToFormatMap)
    return _parserModule.keyword(abstractRuleParams, words, insensitive)