baenv module¶
Manage ballistica execution environment.
This module is used to set up and/or check the global Python environment before running a ballistica app. This includes things such as paths, logging, and app-dirs. Because these things are global in nature, this should be done before any ballistica modules are imported.
This module can also be exec’ed directly to set up a default environment and then run the app.
Ballistica can be used without explicitly configuring the environment in order to integrate it in arbitrary Python environments, but this may cause some features to be disabled or behave differently than expected.
- class baenv.EnvConfig(config_dir: str, data_dir: str, app_python_dir: str | None, standard_app_python_dir: str, site_python_dir: str | None, user_python_dir: str | None, is_user_app_python_dir: bool, log_handler: LogHandler | None, initial_app_config: Any, launch_time: float)[source]¶
Bases:
object
Final config values we provide to the engine.
- app_python_dir: str | None¶
- config_dir: str¶
- data_dir: str¶
- initial_app_config: Any¶
- is_user_app_python_dir: bool¶
- launch_time: float¶
- log_handler: LogHandler | None¶
- site_python_dir: str | None¶
- standard_app_python_dir: str¶
- user_python_dir: str | None¶
- baenv.configure(*, config_dir: str | None = None, data_dir: str | None = None, user_python_dir: str | None = None, app_python_dir: str | None = None, site_python_dir: str | None = None, contains_python_dist: bool = False, setup_logging: bool = True) None [source]¶
Set up the environment for running a Ballistica app.
This includes things such as Python path wrangling and app directory creation. This must be called before any actual Ballistica modules are imported; the environment is locked in as soon as that happens.