winIDEA SDK
Loading...
Searching...
No Matches
test_export_import_project.py
# This script is licensed under BSD License, see file LICENSE.txt, or search for `License` in the SDK online help.
#
# (c) TASKING Germany GmbH, 2023
import os
import tempfile
import isystem.connect as ic
winidea_id = ''
def test_exportImportProject():
connMgr = ic.ConnectionMgr()
connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
projCtrl = ic.CProjectController(connMgr)
with tempfile.TemporaryDirectory() as tmpDir:
tmpFilePath = os.path.join(tmpDir, "proj.xml")
print(f"Exporting project to XML: {tmpFilePath}")
if projCtrl.exportProject(tmpFilePath) == -1:
print(f"\tWarnings: {projCtrl.getWarningMessage()}")
print(f"Importing project from XML: {tmpFilePath}")
if projCtrl.exportProject(tmpFilePath) == -1:
print(f"\tWarnings: {projCtrl.getWarningMessage()}")
if __name__ == "__main__":
test_exportImportProject()