コード例 #1
0
ファイル: import.py プロジェクト: CNCBASHER/skeinforge-1
def processXMLElementByDerivation(derivation, xmlElement):
    'Process the xml element by derivation.'
    if derivation == None:
        derivation = ImportDerivation(xmlElement)
    if derivation.fileName == None:
        return
    parserFileName = xmlElement.getParser().fileName
    absoluteFileName = archive.getAbsoluteFolderPath(parserFileName,
                                                     derivation.fileName)
    if 'models/' not in absoluteFileName:
        print(
            'Warning, models/ was not in the absolute file path, so for security nothing will be done for:'
        )
        print(xmlElement)
        print('For which the absolute file path is:')
        print(absoluteFileName)
        print(
            'The import tool can only read a file which has models/ in the file path.'
        )
        print(
            'To import the file, move the file into a folder called model/ or a subfolder which is inside the model folder tree.'
        )
        return
    xmlText = ''
    if derivation.fileName.endswith('.xml'):
        xmlText = archive.getFileText(absoluteFileName)
    else:
        xmlText = getXMLFromCarvingFileName(absoluteFileName)
    print('The import tool is opening the file:')
    print(absoluteFileName)
    if xmlText == '':
        print(
            'The file %s could not be found by processXMLElement in import.' %
            derivation.fileName)
        return
    if derivation.importName == None:
        xmlElement.importName = archive.getUntilDot(derivation.fileName)
        if derivation.basename:
            xmlElement.importName = os.path.basename(xmlElement.importName)
        xmlElement.attributeDictionary['_importName'] = xmlElement.importName
    else:
        xmlElement.importName = derivation.importName
    importXMLElement = xml_simple_reader.XMLElement()
    xml_simple_reader.XMLSimpleReader(parserFileName, importXMLElement,
                                      xmlText)
    for child in importXMLElement.children:
        child.copyXMLChildren('', xmlElement)
        evaluate.removeIdentifiersFromDictionary(child.attributeDictionary)
        xmlElement.attributeDictionary.update(child.attributeDictionary)
        if derivation.overwriteRoot:
            xmlElement.getRoot().attributeDictionary.update(
                child.attributeDictionary)
    xmlElement.className = 'group'
    evaluate.processArchivable(group.Group, xmlElement)
コード例 #2
0
ファイル: import.py プロジェクト: rkoeppl/SFACT
def processXMLElementByDerivation(derivation, xmlElement):
    """Process the xml element by derivation."""
    if derivation is None:
        derivation = ImportDerivation(xmlElement)
    if derivation.fileName is None:
        return
    parserFileName = xmlElement.getParser().fileName
    absoluteFileName = archive.getAbsoluteFolderPath(parserFileName,
                                                     derivation.fileName)
    if 'models/' not in absoluteFileName:
        print(
            'Warning, models/ was not in the absolute file path, so for security nothing will be done for:'
        )
        print(xmlElement)
        print('For which the absolute file path is:')
        print(absoluteFileName)
        print(
            'The import tool can only read a file which has models/ in the file path.'
        )
        print(
            'To import the file, move the file into a folder called model/ or a subfolder which is inside the model folder tree.'
        )
        return
    xmlText = ''
    if derivation.fileName.endswith('.xml'):
        xmlText = archive.getFileText(absoluteFileName)
    else:
        xmlText = getXMLFromCarvingFileName(absoluteFileName)
    print('The import tool is opening the file:')
    print(absoluteFileName)
    if xmlText == '':
        print('The file %s could not be found by processXMLElement in import.'
              % derivation.fileName)
        return
    if derivation.importName is None:
        xmlElement.importName = archive.getUntilDot(derivation.fileName)
        if derivation.basename:
            xmlElement.importName = os.path.basename(xmlElement.importName)
        xmlElement.attributeDictionary['_importName'] = xmlElement.importName
    else:
        xmlElement.importName = derivation.importName
    importXMLElement = xml_simple_reader.XMLElement()
    xml_simple_reader.XMLSimpleReader(parserFileName, importXMLElement,
                                      xmlText)
    for child in importXMLElement.children:
        child.copyXMLChildren('', xmlElement)
        evaluate.removeIdentifiersFromDictionary(child.attributeDictionary)
        xmlElement.attributeDictionary.update(child.attributeDictionary)
        if derivation.overwriteRoot:
            xmlElement.getRoot().attributeDictionary.update(
                child.attributeDictionary)
    xmlElement.className = 'group'
    evaluate.processArchivable(group.Group, xmlElement)
コード例 #3
0
ファイル: import.py プロジェクト: maestroflema/asimov
def processElementNodeByDerivation(derivation, elementNode):
    'Process the xml element by derivation.'
    if derivation == None:
        derivation = ImportDerivation(elementNode)
    if derivation.fileName == None:
        return
    parserFileName = elementNode.getOwnerDocument().fileName
    absoluteFileName = archive.getAbsoluteFolderPath(parserFileName,
                                                     derivation.fileName)
    if 'models/' not in absoluteFileName:
        print(
            'Warning, models/ was not in the absolute file path, so for security nothing will be done for:'
        )
        print(elementNode)
        print('For which the absolute file path is:')
        print(absoluteFileName)
        print(
            'The import tool can only read a file which has models/ in the file path.'
        )
        print(
            'To import the file, move the file into a folder called model/ or a subfolder which is inside the model folder tree.'
        )
        return
    xmlText = ''
    if derivation.fileName.endswith('.xml'):
        xmlText = archive.getFileText(absoluteFileName)
    else:
        xmlText = getXMLFromCarvingFileName(absoluteFileName)
    print('The import tool is opening the file:')
    print(absoluteFileName)
    if xmlText == '':
        print(
            'The file %s could not be found by processElementNode in import.' %
            derivation.fileName)
        return
    if derivation.importName == None:
        elementNode.attributes['_importName'] = archive.getUntilDot(
            derivation.fileName)
        if derivation.basename:
            elementNode.attributes['_importName'] = os.path.basename(
                elementNode.attributes['_importName'])
    xml_simple_reader.createAppendByText(elementNode, xmlText)
    if derivation.appendDocumentElement:
        appendAttributes(elementNode, elementNode.getDocumentElement())
    if derivation.appendElement:
        appendAttributes(elementNode, elementNode)
    elementNode.localName = 'group'
    evaluate.processArchivable(group.Group, elementNode)
コード例 #4
0
ファイル: import.py プロジェクト: natetrue/ReplicatorG
def processElementNodeByDerivation(derivation, elementNode):
    "Process the xml element by derivation."
    if derivation == None:
        derivation = ImportDerivation(elementNode)
    if derivation.fileName == None:
        return
    parserFileName = elementNode.getOwnerDocument().fileName
    absoluteFileName = archive.getAbsoluteFolderPath(parserFileName, derivation.fileName)
    if "models/" not in absoluteFileName:
        print("Warning, models/ was not in the absolute file path, so for security nothing will be done for:")
        print(elementNode)
        print("For which the absolute file path is:")
        print(absoluteFileName)
        print("The import tool can only read a file which has models/ in the file path.")
        print(
            "To import the file, move the file into a folder called model/ or a subfolder which is inside the model folder tree."
        )
        return
    xmlText = ""
    if derivation.fileName.endswith(".xml"):
        xmlText = archive.getFileText(absoluteFileName)
    else:
        xmlText = getXMLFromCarvingFileName(absoluteFileName)
    print("The import tool is opening the file:")
    print(absoluteFileName)
    if xmlText == "":
        print("The file %s could not be found by processElementNode in import." % derivation.fileName)
        return
    if derivation.importName == None:
        elementNode.attributes["_importName"] = archive.getUntilDot(derivation.fileName)
        if derivation.basename:
            elementNode.attributes["_importName"] = os.path.basename(elementNode.attributes["_importName"])
    xml_simple_reader.createAppendByText(elementNode, xmlText)
    if derivation.appendDocumentElement:
        appendAttributes(elementNode, elementNode.getDocumentElement())
    if derivation.appendElement:
        appendAttributes(elementNode, elementNode)
    elementNode.localName = "group"
    evaluate.processArchivable(group.Group, elementNode)
コード例 #5
0
ファイル: cylinder.py プロジェクト: 3DNogi/SFACT
def processElementNode(elementNode):
	'Process the xml element.'
	evaluate.processArchivable(Cylinder, elementNode)
コード例 #6
0
ファイル: path.py プロジェクト: AKAMEDIASYSTEM/ReplicatorG
def processXMLElement(xmlElement):
	"Process the xml element."
	evaluate.processArchivable(Path, xmlElement)
コード例 #7
0
ファイル: intersection.py プロジェクト: folksjos/RepG
def processElementNode(elementNode):
    "Process the xml element."
    evaluate.processArchivable(Intersection, elementNode)
コード例 #8
0
def processXMLElement(xmlElement):
	"Process the xml element."
	evaluate.processArchivable(Difference, xmlElement)
コード例 #9
0
def processElementNode(elementNode):
	'Process the xml element.'
	evaluate.processArchivable(Cube, elementNode)
コード例 #10
0
ファイル: triangle_mesh.py プロジェクト: 3DNogi/SFACT
def processElementNode(elementNode):
	'Process the xml element.'
	evaluate.processArchivable(TriangleMesh, elementNode)
コード例 #11
0
ファイル: group.py プロジェクト: 3DNogi/SFACT
def processElementNode(elementNode):
	"Process the xml element."
	evaluate.processArchivable(Group, elementNode)
コード例 #12
0
ファイル: difference.py プロジェクト: zaubara/Curation
def processElementNode(elementNode):
    "Process the xml element."
    evaluate.processArchivable(Difference, elementNode)
コード例 #13
0
ファイル: intersection.py プロジェクト: Sciumo/SFACT
def processXMLElement(xmlElement):
	"""Process the xml element."""
	evaluate.processArchivable(Intersection, xmlElement)
コード例 #14
0
ファイル: path.py プロジェクト: aliensr85/Skeinforge-Mirror
def processXMLElement(xmlElement, xmlProcessor):
    "Process the xml element."
    evaluate.processArchivable(Path, xmlElement, xmlProcessor)
コード例 #15
0
def processElementNode(elementNode):
    'Process the xml element.'
    evaluate.processArchivable(Dictionary, elementNode)
コード例 #16
0
def processXMLElement(xmlElement):
	'Process the xml element.'
	evaluate.processArchivable(Cylinder, xmlElement)
コード例 #17
0
def processElementNode(elementNode):
	'Process the xml element.'
	evaluate.processArchivable(TriangleMesh, elementNode)
コード例 #18
0
ファイル: dictionary.py プロジェクト: 1060460048/Cura
def processElementNode(elementNode):
	'Process the xml element.'
	evaluate.processArchivable( Dictionary, elementNode)
コード例 #19
0
def processXMLElement(xmlElement):
    'Process the xml element.'
    evaluate.processArchivable(TriangleMesh, xmlElement)
コード例 #20
0
def processElementNode(elementNode):
    "Process the xml element."
    evaluate.processArchivable(group.Group, elementNode)
コード例 #21
0
ファイル: _comment.py プロジェクト: CNCBASHER/skeinforge-1
def processXMLElement(xmlElement):
    "Process the xml element."
    evaluate.processArchivable(_Comment, xmlElement)
コード例 #22
0
ファイル: difference.py プロジェクト: 1060460048/Cura
def processElementNode(elementNode):
	"Process the xml element."
	evaluate.processArchivable(Difference, elementNode)
コード例 #23
0
def processXMLElement(xmlElement):
	'Process the xml element.'
	evaluate.processArchivable(Sphere, xmlElement)
コード例 #24
0
ファイル: dictionary.py プロジェクト: miso-/SkeinforgeEngine
def processXMLElement(xmlElement):
    'Process the xml element.'
    evaluate.processArchivable( Dictionary, xmlElement)
コード例 #25
0
ファイル: intersection.py プロジェクト: folksjos/RepG
def processElementNode(elementNode):
	"Process the xml element."
	evaluate.processArchivable(Intersection, elementNode)
コード例 #26
0
ファイル: cube.py プロジェクト: Sciumo/SFACT
def processXMLElement(xmlElement):
	"""Process the xml element."""
	evaluate.processArchivable(Cube, xmlElement)
コード例 #27
0
ファイル: triangle_mesh.py プロジェクト: koenkooi/ReplicatorG
def processXMLElement(xmlElement):
    "Process the xml element."
    evaluate.processArchivable(TriangleMesh, xmlElement)
コード例 #28
0
ファイル: dictionary.py プロジェクト: clothbot/DotSkeinforge
def processXMLElement(xmlElement, xmlProcessor):
    "Process the xml element."
    evaluate.processArchivable(Dictionary, xmlElement, xmlProcessor)
コード例 #29
0
ファイル: dictionary.py プロジェクト: folksjos/RepG
def processXMLElement(xmlElement):
	"Process the xml element."
	evaluate.processArchivable( Dictionary, xmlElement)
コード例 #30
0
def processXMLElement(xmlElement):
    'Process the xml element.'
    evaluate.processArchivable(Path, xmlElement)
コード例 #31
0
def processXMLElement(xmlElement):
    "Process the xml element."
    evaluate.processArchivable(Intersection, xmlElement)
コード例 #32
0
ファイル: path.py プロジェクト: Aeva/SFACT
def processElementNode(elementNode):
	'Process the xml element.'
	evaluate.processArchivable(Path, elementNode)
コード例 #33
0
ファイル: _comment.py プロジェクト: clothbot/DotSkeinforge
def processXMLElement( xmlElement, xmlProcessor ):
	"Process the xml element."
	evaluate.processArchivable( _Comment, xmlElement, xmlProcessor )