#!/usr/bin/python3
# @file
# @ingroup pyremoteapi
# @copyright
#   SPDX-FileCopyrightText: 2026 European Southern Observatory (ESO)
#   SPDX-License-Identifier: LGPL-3.0-only
#
# @brief Python remote client as an example

import sys

import DdtRemoteLib

if __name__ == "__main__":
    remote_client = DdtRemoteLib.DdtRemoteClient()

    result = remote_client.Init(sys.argv)

    if result == DdtRemoteLib.INIT_HELP:
        exit(0)

    if result in (DdtRemoteLib.INIT_PARSE_ERROR, DdtRemoteLib.INIT_ERROR):
        exit(1)

    response = remote_client.Run()
    print("Response received: " + response)

    print("DdtRemoteClient stopped")
