Files
revpi-middleware/src/revpi_middleware/__main__.py
Sven Sager cc5eb516bf feat: Add python base project files
These files create a callable Python package and manage the version
number of the complete project in the __about__.py file only. All other
parts, including Makefile, will use that version number.
2025-04-17 12:06:14 +02:00

29 lines
838 B
Python

# -*- coding: utf-8 -*-
# SPDX-FileCopyrightText: 2025 KUNBUS GmbH
# SPDX-License-Identifier: GPL-2.0-or-later
"""Start main application of this package."""
# If we are running from a wheel, add the wheel to sys.path
if __package__ == "":
from os.path import dirname
from sys import path
# __file__ is package-*.whl/package/__main__.py
# Resulting path is the name of the wheel itself
package_path = dirname(dirname(__file__))
path.insert(0, package_path)
if __name__ == "__main__":
import sys
try:
# Use absolute import in the __main__ module
from revpi_middleware.main_application import main
# Run the main application of this package
sys.exit(main())
except Exception as e:
sys.stderr.write(f"Can not start __main__ module: {e}\n")
sys.exit(1)