logger.debug(f'Python C API version: {sys.api_version}')
logger.debug(f'Python path: {sys.path}')
+ # Log something about the site_config, many things use it.
+ import site_config
+
+ logger.debug(f'Global site_config: {site_config.get_config()}')
+
# Allow programs that don't bother to override the random seed
# to be replayed via the commandline.
import random
return location
-def get_config(location_override: Optional[str] = None):
- """
- Get a configuration dataclass with information that is
- site-specific including the current running location.
-
- >>> cfg = get_config()
- >>> cfg.location_name == 'HOUSE' or cfg.location_name == 'CABIN'
- True
-
- """
+def effective_location(location_override: Optional[str] = None) -> str:
if location_override is None:
try:
location_override = config.config['site_config_override_location']
if location_override is None or location_override == 'NONE':
location = this_location()
else:
+ logger.debug(f'site_config\'s location_override was set to: {location_override}')
location = location_override
+ return location
+
+def get_config(location_override: Optional[str] = None):
+ """
+ Get a configuration dataclass with information that is
+ site-specific including the current running location.
+
+ >>> cfg = get_config()
+ >>> cfg.location_name == 'HOUSE' or cfg.location_name == 'CABIN'
+ True
+
+ """
+ location = effective_location(location_override)
if location == 'HOUSE':
return SiteConfig(
location_name='HOUSE',