Cleanup
[carla.git] / source / frontend / carla
blob6e7d97ad8ef4fe398661548900194475b66c9c73
1 #!/usr/bin/env python3
2 # SPDX-FileCopyrightText: 2011-2024 Filipe Coelho <falktx@falktx.com>
3 # SPDX-License-Identifier: GPL-2.0-or-later
5 # ----------------------------------------------------------------------------------------------------------------------
6 # Imports (Custom Stuff)
8 from carla_app import (
9     CarlaApplication,
12 from carla_host import (
13     HostWindow,
14     initHost,
15     loadHostSettings,
18 from carla_shared import (
19     handleInitialCommandLineArguments,
20     setUpSignals,
23 # ----------------------------------------------------------------------------------------------------------------------
24 # Main
26 if __name__ == '__main__':
27     import resources_rc
29     # ------------------------------------------------------------------------------------------------------------------
30     # Read CLI args
32     initName, libPrefix = handleInitialCommandLineArguments(__file__ if "__file__" in dir() else None)
34     # ------------------------------------------------------------------------------------------------------------------
35     # App initialization
37     app = CarlaApplication("Carla2", libPrefix)
39     # ------------------------------------------------------------------------------------------------------------------
40     # Set-up custom signal handling
42     setUpSignals()
44     # ------------------------------------------------------------------------------------------------------------------
45     # Init host backend
47     host = initHost(initName, libPrefix, False, False, True)
48     loadHostSettings(host)
50     # ------------------------------------------------------------------------------------------------------------------
51     # Create GUI
53     gui = HostWindow(host, True)
55     # ------------------------------------------------------------------------------------------------------------------
56     # Show GUI
58     gui.showIfNeeded()
60     # ------------------------------------------------------------------------------------------------------------------
61     # App-Loop
63     app.exit_exec()