chiark / gitweb /
Move SF into its own directory, to seperate SF and Cura. Rename newui to gui.
[cura.git] / Cura / cura_sf / fabmetheus_utilities / geometry / statements / while.py
1 """
2 Polygon path.
3
4 """
5
6 from __future__ import absolute_import
7 #Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module.
8 import __init__
9
10 from fabmetheus_utilities.geometry.geometry_utilities import evaluate
11
12
13 __author__ = 'Enrique Perez (perez_enrique@yahoo.com)'
14 __credits__ = 'Art of Illusion <http://www.artofillusion.org/>'
15 __date__ = '$Date: 2008/02/05 $'
16 __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
17
18
19 def processElementNode(elementNode):
20         "Process the xml element."
21         if elementNode.xmlObject == None:
22                 if 'condition' in elementNode.attributes:
23                         value = elementNode.attributes['condition']
24                         elementNode.xmlObject = evaluate.getEvaluatorSplitWords(value)
25                 else:
26                         elementNode.xmlObject = []
27         if len( elementNode.xmlObject ) < 1:
28                 return
29         xmlProcessor = elementNode.getXMLProcessor()
30         if len( xmlProcessor.functions ) < 1:
31                 return
32         function = xmlProcessor.functions[-1]
33         while evaluate.getEvaluatedExpressionValueBySplitLine(elementNode, elementNode.xmlObject) > 0:
34                 function.processChildNodes(elementNode)