import isystem.connect as ic
winidea_id = ''
def test_hotAttachDetach():
connMgr = ic.ConnectionMgr()
connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
execCtrl = ic.CExecutionController(connMgr)
sess_ctrl = ic.CSessionCtrl(connMgr)
sess_ctrl.begin_prepare()
if execCtrl.hotDetach() == 0:
print(f"Hot detach succeeded, winIDEA is in `detached` state.")
if execCtrl.hotAttach() == 0:
print(f"Hot attach succeeded, winIDEA is connected.")
execCtrl.stop()
if __name__ == "__main__":
test_hotAttachDetach()