Exemple #1
0
 def importModule(self):
     "Import the python script and store the layers."
     path = os.path.abspath(self.untilDotName)
     pluginModule = gcodec.getModuleWithPath(path)
     loopLayers = pluginModule.getLoopLayers(self.layerThickness)
     for loopLayer in loopLayers:
         rotatedBoundaryLayer = euclidean.RotatedLoopLayer(loopLayer.z)
         rotatedBoundaryLayer.loops = loopLayer.loops
         self.rotatedBoundaryLayers.append(rotatedBoundaryLayer)
Exemple #2
0
	def importModule( self ):
		"Import the python script and store the layers."
		path = os.path.abspath( self.untilDotName )
		pluginModule = gcodec.getModuleWithPath( path )
		loopLayers = pluginModule.getLoopLayers( self.layerThickness )
		for loopLayer in loopLayers:
			rotatedBoundaryLayer = euclidean.RotatedLoopLayer( loopLayer.z )
			rotatedBoundaryLayer.loops = loopLayer.loops
			self.rotatedBoundaryLayers.append( rotatedBoundaryLayer )
	def processXMLElement( self, xmlElement ):
		"Process the xml element."
		lowerClassName = xmlElement.className.lower()
		if lowerClassName not in self.namePathDictionary:
			return None
		pluginModule = gcodec.getModuleWithPath( self.namePathDictionary[ lowerClassName ] )
		if pluginModule == None:
			return None
		return pluginModule.processXMLElement( xmlElement, self )
Exemple #4
0
 def processXMLElement(self, xmlElement):
     "Process the xml element."
     lowerClassName = xmlElement.className.lower()
     if lowerClassName not in self.namePathDictionary:
         return None
     pluginModule = gcodec.getModuleWithPath(
         self.namePathDictionary[lowerClassName])
     if pluginModule == None:
         return None
     return pluginModule.processXMLElement(xmlElement, self)
	def convertXMLElement( self, geometryOutput, xmlElement ):
		"Convert the xml element."
		geometryOutputKeys = geometryOutput.keys()
		if len( geometryOutputKeys ) < 1:
			return None
		firstKey = geometryOutputKeys[ 0 ]
		lowerClassName = firstKey.lower()
		if lowerClassName not in self.namePathDictionary:
			return None
		pluginModule = gcodec.getModuleWithPath( self.namePathDictionary[ lowerClassName ] )
		if pluginModule == None:
			return None
		xmlElement.className = lowerClassName
		return pluginModule.convertXMLElement( geometryOutput[ firstKey ], xmlElement, self )
Exemple #6
0
def _getAccessibleAttribute(attributeName, xmlElement):
	'Get the accessible attribute.'
	functionName = attributeName[len('get') :].lower()
	if functionName not in evaluate.globalCreationDictionary:
		print('Warning, functionName not in globalCreationDictionary in _getAccessibleAttribute in creation for:')
		print(functionName)
		print(xmlElement)
		return None
	pluginModule = gcodec.getModuleWithPath(evaluate.globalCreationDictionary[functionName])
	if pluginModule == None:
		print('Warning, _getAccessibleAttribute in creation can not get a pluginModule for:')
		print(functionName)
		print(xmlElement)
		return None
	return Creation(pluginModule, xmlElement).getCreation
def _getAccessibleAttribute(attributeName, xmlElement):
	'Get the accessible attribute.'
	functionName = attributeName[len('get') :].lower()
	if functionName not in evaluate.globalCreationDictionary:
		print('Warning, functionName not in globalCreationDictionary in _getAccessibleAttribute in creation for:')
		print(functionName)
		print(xmlElement)
		return None
	pluginModule = gcodec.getModuleWithPath(evaluate.globalCreationDictionary[functionName])
	if pluginModule == None:
		print('Warning, _getAccessibleAttribute in creation can not get a pluginModule for:')
		print(functionName)
		print(xmlElement)
		return None
	return Creation(pluginModule, xmlElement).getCreation
Exemple #8
0
 def convertXMLElement(self, geometryOutput, xmlElement):
     "Convert the xml element."
     geometryOutputKeys = geometryOutput.keys()
     if len(geometryOutputKeys) < 1:
         return None
     firstKey = geometryOutputKeys[0]
     lowerClassName = firstKey.lower()
     if lowerClassName not in self.namePathDictionary:
         return None
     pluginModule = gcodec.getModuleWithPath(
         self.namePathDictionary[lowerClassName])
     if pluginModule == None:
         return None
     xmlElement.className = lowerClassName
     return pluginModule.convertXMLElement(geometryOutput[firstKey],
                                           xmlElement, self)
Exemple #9
0
	def processXMLElement(self, xmlElement):
		"Process the xml element."
		lowerClassName = xmlElement.className.lower()
		if lowerClassName not in self.namePathDictionary:
			return None
		pluginModule = gcodec.getModuleWithPath( self.namePathDictionary[ lowerClassName ] )
		if pluginModule == None:
			return None
		try:
			return pluginModule.processXMLElement(xmlElement)
		except:
			print('Warning, could not processXMLElement in fabmetheus for:')
			print( pluginModule )
			print(xmlElement)
			traceback.print_exc(file=sys.stdout)
		return None
Exemple #10
0
 def processXMLElement(self, xmlElement):
     "Process the xml element."
     lowerClassName = xmlElement.className.lower()
     if lowerClassName not in self.namePathDictionary:
         return None
     pluginModule = gcodec.getModuleWithPath(
         self.namePathDictionary[lowerClassName])
     if pluginModule == None:
         return None
     try:
         return pluginModule.processXMLElement(xmlElement)
     except:
         print('Warning, could not processXMLElement in fabmetheus for:')
         print(pluginModule)
         print(xmlElement)
         traceback.print_exc(file=sys.stdout)
     return None