Beispiel #1
0
    def Save(self, obj_dumped, fileName=None):

        assert (fileName.endswith(tuple(DumpXMLFile.ext)))

        diagram = obj_dumped
        D = diagram.__class__.makeDEVSGraph(diagram, {})
        label = diagram.label if isinstance(
            diagram, Components.GenericComponent) else os.path.splitext(
                os.path.basename(fileName))[0]
        makeDEVSXML(label, D, fileName)

        return True
Beispiel #2
0
	def Save(self, obj_dumped, fileName = None):

		assert(fileName.endswith(tuple(DumpXMLFile.ext)))

		diagram = obj_dumped
		D = diagram.__class__.makeDEVSGraph(diagram, {})

		if isinstance(diagram, Components.GenericComponent):
			label = diagram.label
		else:
			label = os.path.splitext(os.path.basename(fileName))[0]

		makeDEVSXML(label, D, fileName)

		return True