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

import sys

import DdtDataBroker

if __name__ == "__main__":
    broker = DdtDataBroker.DdtDataBroker()

    result = broker.Init(sys.argv)

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

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

    if not broker.Run():
        exit(1)
