daemon: Initial support for writing different versions of XML scenario files.
This commit is contained in:
parent
899b5ae5be
commit
ca8856d6c8
3 changed files with 388 additions and 376 deletions
|
@ -14,7 +14,7 @@ the main public interface here.
|
|||
import os.path
|
||||
from core.netns import nodes
|
||||
from xmlparser import core_document_parser
|
||||
from xmlwriter import CoreDocumentWriter
|
||||
from xmlwriter import core_document_writer
|
||||
|
||||
def opensessionxml(session, filename, start=False, nodecls=nodes.CoreNode):
|
||||
''' Import a session from the EmulationScript XML format.
|
||||
|
@ -27,8 +27,8 @@ def opensessionxml(session, filename, start=False, nodecls=nodes.CoreNode):
|
|||
session.node_count = str(session.getnodecount())
|
||||
session.instantiate()
|
||||
|
||||
def savesessionxml(session, filename):
|
||||
def savesessionxml(session, filename, version = 0.0):
|
||||
''' Export a session to the EmulationScript XML format.
|
||||
'''
|
||||
doc = CoreDocumentWriter(session)
|
||||
doc = core_document_writer(session, version)
|
||||
doc.writexml(filename)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue