oedb-backend/oedb/resources/demo/__init__.py
2025-09-22 11:44:25 +02:00

29 lines
No EOL
1 KiB
Python

"""
Demo package for the OpenEventDatabase.
This package contains modules for the demo endpoints.
"""
from oedb.resources.demo.demo_main import demo_main
from oedb.resources.demo.demo_traffic import demo_traffic
from oedb.resources.demo.demo_stats import demo_stats
from oedb.resources.demo.demo_view_events import demo_view_events
# Import DemoResource class from the original demo.py file
import sys
import os
import importlib.util
# Get the path to the original demo.py file
demo_py_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'demo.py')
# Load the demo.py module
spec = importlib.util.spec_from_file_location("oedb.resources.demo_original", demo_py_path)
demo_original = importlib.util.module_from_spec(spec)
sys.modules["oedb.resources.demo_original"] = demo_original
spec.loader.exec_module(demo_original)
# Get the demo object from the original module
demo = demo_original.demo
# Export the demo resources and the demo object
__all__ = ['demo_main', 'demo_traffic', 'demo_view_events', 'demo_stats', 'demo']