コード例 #1
0
ファイル: _print.py プロジェクト: zaubara/Curation
def printAttributesKey(attributesKey, elementNode):
    "Print the attributesKey."
    if attributesKey.lower() == '_localdictionary':
        localDictionary = getLocalDictionary(attributesKey, elementNode)
        if localDictionary != None:
            localDictionaryKeys = localDictionary.keys()
            attributeValue = elementNode.attributes[attributesKey]
            if attributeValue != '':
                attributeValue = ' - ' + attributeValue
            print('Local Dictionary Variables' + attributeValue)
            localDictionaryKeys.sort()
            for localDictionaryKey in localDictionaryKeys:
                print(
                    '%s: %s' %
                    (localDictionaryKey, localDictionary[localDictionaryKey]))
            return
    value = elementNode.attributes[attributesKey]
    evaluatedValue = None
    if value == '':
        evaluatedValue = evaluate.getEvaluatedExpressionValue(
            elementNode, attributesKey)
    else:
        evaluatedValue = evaluate.getEvaluatedExpressionValue(
            elementNode, value)
    print('%s: %s' % (attributesKey, evaluatedValue))
コード例 #2
0
ファイル: _print.py プロジェクト: folksjos/RepG
def printAttributesKey( attributesKey, elementNode):
	"Print the attributesKey."
	if attributesKey.lower() == '_localdictionary':
		localDictionary = getLocalDictionary( attributesKey, elementNode)
		if localDictionary != None:
			localDictionaryKeys = localDictionary.keys()
			attributeValue = elementNode.attributes[attributesKey]
			if attributeValue != '':
				attributeValue = ' - ' + attributeValue
			print('Local Dictionary Variables' + attributeValue )
			localDictionaryKeys.sort()
			for localDictionaryKey in localDictionaryKeys:
				print('%s: %s' % ( localDictionaryKey, localDictionary[ localDictionaryKey ] ) )
			return
	value = elementNode.attributes[attributesKey]
	evaluatedValue = None
	if value == '':
		evaluatedValue = evaluate.getEvaluatedExpressionValue(elementNode, attributesKey)
	else:
		evaluatedValue = evaluate.getEvaluatedExpressionValue(elementNode, value)
	print('%s: %s' % ( attributesKey, evaluatedValue ) )
コード例 #3
0
ファイル: _print.py プロジェクト: Sciumo/SFACT
def printAttributeDictionaryKey( attributeDictionaryKey, xmlElement):
	"""Print the attributeDictionaryKey."""
	if attributeDictionaryKey.lower() == '_localdictionary':
		localDictionary = getLocalDictionary( attributeDictionaryKey, xmlElement)
		if localDictionary is not None:
			localDictionaryKeys = localDictionary.keys()
			attributeValue = xmlElement.attributeDictionary[attributeDictionaryKey]
			if attributeValue != '':
				attributeValue = ' - ' + attributeValue
			print('Local Dictionary Variables' + attributeValue )
			localDictionaryKeys.sort()
			for localDictionaryKey in localDictionaryKeys:
				print('%s: %s' % ( localDictionaryKey, localDictionary[ localDictionaryKey ] ) )
			return
	value = xmlElement.attributeDictionary[attributeDictionaryKey]
	evaluatedValue = None
	if value == '':
		evaluatedValue = evaluate.getEvaluatedExpressionValue( attributeDictionaryKey, xmlElement )
	else:
		evaluatedValue = evaluate.getEvaluatedExpressionValue(value, xmlElement)
	print('%s: %s' % ( attributeDictionaryKey, evaluatedValue ) )