def processTargetByFunction(manipulationFunction, target):
 if (target.xmlObject == None):
  print 'Warning, there is no object in processTargetByFunction in lineation for:'
  print target
  return
 geometryOutput = []
 transformedPaths = target.xmlObject.getTransformedPaths()
 for transformedPath in transformedPaths:
  sideLoop = SideLoop(transformedPath)
  sideLoop.rotate(target)
  sideLoop.loop = euclidean.getLoopWithoutCloseSequentialPoints(sideLoop.close, sideLoop.loop)
  geometryOutput += manipulationFunction(sideLoop.close, target, sideLoop.loop, '', sideLoop.sideLength)
 if (len(geometryOutput) < 1):
  print 'Warning, there is no geometryOutput in processTargetByFunction in lineation for:'
  print target
  return
 removeChildNodesFromElementObject(target)
 path.convertElementNode(target, geometryOutput)

def processTargetByFunction ( manipulationFunction , target ) : if ( target . xmlObject == None ) : print 'Warning, there is no object in processTargetByFunction in lineation for:' print target return geometryOutput = [ ] transformedPaths = target . xmlObject . getTransformedPaths ( ) for transformedPath in transformedPaths : sideLoop = SideLoop ( transformedPath ) sideLoop . rotate ( target ) sideLoop . loop = euclidean . getLoopWithoutCloseSequentialPoints ( sideLoop . close , sideLoop . loop ) geometryOutput += manipulationFunction ( sideLoop . close , target , sideLoop . loop , '' , sideLoop . sideLength ) if ( len ( geometryOutput ) < 1 ) : print 'Warning, there is no geometryOutput in processTargetByFunction in lineation for:' print target return removeChildNodesFromElementObject ( target ) path . convertElementNode ( target , geometryOutput )
process the target by the manipulationfunction .