6 from __future__ import absolute_import
8 from fabmetheus_utilities.geometry.geometry_utilities import evaluate
11 __author__ = 'Enrique Perez (perez_enrique@yahoo.com)'
12 __credits__ = 'Art of Illusion <http://www.artofillusion.org/>'
13 __date__ = '$Date: 2008/02/05 $'
14 __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
17 def processElementNode(elementNode):
18 "Process the xml element."
19 functions = elementNode.getXMLProcessor().functions
20 if len(functions) < 1:
21 print('Warning, there are no functions in processElementNode in statement for:')
24 function = functions[-1]
25 evaluate.setLocalAttribute(elementNode)
26 if elementNode.xmlObject.value == None:
27 print('Warning, elementNode.xmlObject.value is None in processElementNode in statement for:')
30 localValue = evaluate.getEvaluatedExpressionValueBySplitLine(elementNode, elementNode.xmlObject.value)
31 keywords = elementNode.xmlObject.key.split('.')
32 if len(keywords) == 0:
33 print('Warning, there are no keywords in processElementNode in statement for:')
36 firstWord = keywords[0]
37 if len(keywords) == 1:
38 function.localDictionary[firstWord] = localValue
40 attributeName = keywords[-1]
42 if firstWord == 'self':
43 object = function.classObject
45 object = function.localDictionary[firstWord]
46 for keywordIndex in xrange(1, len(keywords) - 1):
47 object = object._getAccessibleAttribute(keywords[keywordIndex])
48 object._setAccessibleAttribute(attributeName, localValue)