Esempio n. 1
0
	def __init__(self, elementNode, equationFunction, key):
		"Initialize."
		self.distance = 0.0
		elementNode.xmlObject = evaluate.getEvaluatorSplitWords(elementNode.attributes[key])
		self.equationFunction = equationFunction
		self.function = evaluate.Function(elementNode)
		self.points = []
Esempio n. 2
0
 def __init__(self, key, revolutions, xmlElement):
     "Initialize."
     self.function = evaluate.Function(
         evaluate.getEvaluatorSplitWords(xmlElement.attributeDictionary[key]), xmlElement
     )
     self.points = []
     self.revolutions = revolutions
Esempio n. 3
0
	def __init__(self, elementNode, equationFunction, key):
		"Initialize."
		self.distance = 0.0
		elementNode.xmlObject = evaluate.getEvaluatorSplitWords(elementNode.attributes[key])
		self.equationFunction = equationFunction
		self.function = evaluate.Function(elementNode)
		self.points = []
Esempio n. 4
0
	def __init__(self, key, revolutions, xmlElement):
		"""Initialize."""
		self.distance = 0.0
		xmlElement.xmlObject = evaluate.getEvaluatorSplitWords(xmlElement.attributeDictionary[key])
		self.function = evaluate.Function(xmlElement)
		self.points = []
		self.revolutions = revolutions
Esempio n. 5
0
 def __init__(self, key, revolutions, xmlElement):
     "Initialize."
     self.distance = 0.0
     xmlElement.xmlObject = evaluate.getEvaluatorSplitWords(
         xmlElement.attributeDictionary[key])
     self.function = evaluate.Function(xmlElement)
     self.points = []
     self.revolutions = revolutions
Esempio n. 6
0
def getLocalAttribute(xmlElement):
	"Get the local attribute if any."
	for key in xmlElement.attributeDictionary:
		if key[ : 1 ].isalpha():
			value = evaluate.getEvaluatorSplitWords( xmlElement.attributeDictionary[ key ] )
			if key.startswith('local.'):
				return evaluate.KeyValue( key[ len('local.') : ], value )
			return evaluate.KeyValue( key, value )
	return evaluate.KeyValue()
Esempio n. 7
0
def getLocalAttribute(xmlElement):
    "Get the local attribute if any."
    for key in xmlElement.attributeDictionary:
        if key[:1].isalpha():
            value = evaluate.getEvaluatorSplitWords(
                xmlElement.attributeDictionary[key])
            if key.startswith('local.'):
                return evaluate.KeyValue(key[len('local.'):], value)
            return evaluate.KeyValue(key, value)
    return evaluate.KeyValue()
Esempio n. 8
0
def processXMLElement( xmlElement, xmlProcessor ):
	"Process the xml element."
	functions = xmlProcessor.functions
	if len( functions ) < 1:
		return
	function = functions[ - 1 ]
	function.shouldReturn = True
	if xmlElement.object == None:
		if 'return' in xmlElement.attributeDictionary:
			value = xmlElement.attributeDictionary['return']
			xmlElement.object = evaluate.getEvaluatorSplitWords( value )
		else:
			xmlElement.object = []
	if len( xmlElement.object ) > 0:
		function.returnValue = evaluate.getEvaluatedExpressionValueBySplitLine( xmlElement.object, xmlElement )
Esempio n. 9
0
def processXMLElement(xmlElement):
	"Process the xml element."
	functions = xmlElement.getXMLProcessor().functions
	if len(functions) < 1:
		return
	function = functions[-1]
	function.shouldReturn = True
	if xmlElement.object == None:
		if 'return' in xmlElement.attributeDictionary:
			value = xmlElement.attributeDictionary['return']
			xmlElement.object = evaluate.getEvaluatorSplitWords(value)
		else:
			xmlElement.object = []
	if len( xmlElement.object ) > 0:
		function.returnValue = evaluate.getEvaluatedExpressionValueBySplitLine( xmlElement.object, xmlElement )
Esempio n. 10
0
def processXMLElement( xmlElement, xmlProcessor ):
	"Process the xml element."
	if xmlElement.object == None:
		if 'condition' in xmlElement.attributeDictionary:
			value = xmlElement.attributeDictionary['condition']
			xmlElement.object = evaluate.getEvaluatorSplitWords( value )
		else:
			xmlElement.object = []
	if len( xmlElement.object ) < 1:
		return
	if len( xmlProcessor.functions ) < 1:
		return
	function = xmlProcessor.functions[ - 1 ]
	while evaluate.getEvaluatedExpressionValueBySplitLine( xmlElement.object, xmlElement ) > 0:
		function.processChildren(xmlElement)
Esempio n. 11
0
def processElementNode(elementNode):
	"Process the xml element."
	functions = elementNode.getXMLProcessor().functions
	if len(functions) < 1:
		return
	function = functions[-1]
	function.shouldReturn = True
	if elementNode.xmlObject == None:
		if 'return' in elementNode.attributes:
			value = elementNode.attributes['return']
			elementNode.xmlObject = evaluate.getEvaluatorSplitWords(value)
		else:
			elementNode.xmlObject = []
	if len( elementNode.xmlObject ) > 0:
		function.returnValue = evaluate.getEvaluatedExpressionValueBySplitLine(elementNode, elementNode.xmlObject)
Esempio n. 12
0
File: while.py Progetto: Ademan/Cura
def processElementNode(elementNode):
	"Process the xml element."
	if elementNode.xmlObject == None:
		if 'condition' in elementNode.attributes:
			value = elementNode.attributes['condition']
			elementNode.xmlObject = evaluate.getEvaluatorSplitWords(value)
		else:
			elementNode.xmlObject = []
	if len( elementNode.xmlObject ) < 1:
		return
	xmlProcessor = elementNode.getXMLProcessor()
	if len( xmlProcessor.functions ) < 1:
		return
	function = xmlProcessor.functions[-1]
	while evaluate.getEvaluatedExpressionValueBySplitLine(elementNode, elementNode.xmlObject) > 0:
		function.processChildNodes(elementNode)
Esempio n. 13
0
def processXMLElement(xmlElement, xmlProcessor):
    "Process the xml element."
    if xmlElement.object == None:
        if 'condition' in xmlElement.attributeDictionary:
            value = xmlElement.attributeDictionary['condition']
            xmlElement.object = evaluate.getEvaluatorSplitWords(value)
        else:
            xmlElement.object = []
    if len(xmlElement.object) < 1:
        return
    if len(xmlProcessor.functions) < 1:
        return
    function = xmlProcessor.functions[-1]
    while evaluate.getEvaluatedExpressionValueBySplitLine(
            xmlElement.object, xmlElement) > 0:
        function.processChildren(xmlElement)
Esempio n. 14
0
def processElementNode(elementNode):
    "Process the xml element."
    if elementNode.xmlObject == None:
        if 'condition' in elementNode.attributes:
            value = elementNode.attributes['condition']
            elementNode.xmlObject = evaluate.getEvaluatorSplitWords(value)
        else:
            elementNode.xmlObject = []
    if len(elementNode.xmlObject) < 1:
        return
    xmlProcessor = elementNode.getXMLProcessor()
    if len(xmlProcessor.functions) < 1:
        return
    function = xmlProcessor.functions[-1]
    while evaluate.getEvaluatedExpressionValueBySplitLine(
            elementNode, elementNode.xmlObject) > 0:
        function.processChildNodes(elementNode)
Esempio n. 15
0
	def __init__(self, elementNode):
		"Initialize."
		self.inSplitWords = None
		self.indexName = ''
		if 'index' in elementNode.attributes:
			self.indexName = elementNode.attributes['index']
		self.valueName = ''
		if 'value' in elementNode.attributes:
			self.valueName = elementNode.attributes['value']
		if 'in' in elementNode.attributes:
			self.inSplitWords = evaluate.getEvaluatorSplitWords( elementNode.attributes['in'] )
		else:
			print('Warning, could not find the "in" attribute in IndexValue in for.py for:')
			print(elementNode)
			return
		if len( self.inSplitWords ) < 1:
			self.inSplitWords = None
			print('Warning, could not get split words for the "in" attribute in IndexValue in for.py for:')
			print(elementNode)
Esempio n. 16
0
	def __init__(self, xmlElement):
		"Initialize."
		self.inSplitWords = None
		self.indexName = ''
		if 'index' in xmlElement.attributeDictionary:
			self.indexName = xmlElement.attributeDictionary['index']
		self.valueName = ''
		if 'value' in xmlElement.attributeDictionary:
			self.valueName = xmlElement.attributeDictionary['value']
		if 'in' in xmlElement.attributeDictionary:
			self.inSplitWords = evaluate.getEvaluatorSplitWords( xmlElement.attributeDictionary['in'] )
		else:
			print('Warning, could not find the "in" attribute in IndexValue in for.py for:')
			print(xmlElement)
			return
		if len( self.inSplitWords ) < 1:
			self.inSplitWords = None
			print('Warning, could not get split words for the "in" attribute in IndexValue in for.py for:')
			print(xmlElement)