コード例 #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)
コード例 #2
0
ファイル: py.py プロジェクト: chriskyfung/MakerDroid
	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 )
コード例 #3
0
ファイル: fabmetheus.py プロジェクト: elmom/Skeinforge-Mirror
	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 )
コード例 #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)
コード例 #5
0
ファイル: fabmetheus.py プロジェクト: elmom/Skeinforge-Mirror
	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 )
コード例 #6
0
ファイル: creation.py プロジェクト: mccoyn/SkeinFactory
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
コード例 #7
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
コード例 #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)
コード例 #9
0
ファイル: fabmetheus.py プロジェクト: mccoyn/SkeinFactory
	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
コード例 #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