Skip to content

Commit 51d5f52

Browse files
committed
respond to comments
1 parent 45596aa commit 51d5f52

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

src/blueapi/cli/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from bluesky_stomp.models import Broker
1212
from observability_utils.tracing import setup_tracing
1313
from pydantic import ValidationError
14+
from pydantic_settings.sources import PathType
1415
from requests.exceptions import ConnectionError
1516

1617
from blueapi import __version__
@@ -32,7 +33,7 @@
3233
"-c", "--config", type=Path, help="Path to configuration YAML file", multiple=True
3334
)
3435
@click.pass_context
35-
def main(ctx: click.Context, config: Path | None | tuple[Path, ...]) -> None:
36+
def main(ctx: click.Context, config: PathType) -> None:
3637
# Override default yaml_file path in the model_config if `config` is provided
3738
ApplicationConfig.model_config["yaml_file"] = config
3839
app_config = ApplicationConfig() # Instantiates with customized sources

src/blueapi/config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ class ApplicationConfig(BaseSettings, cli_parse_args=True, cli_prog_name="blueap
9595
)
9696

9797
@classmethod
98-
def customize_sources(cls, init_settings, env_settings, file_secret_settings):
98+
def settings_customize_sources(
99+
cls, init_settings, env_settings, file_secret_settings
100+
):
99101
path = cls.model_config.get("yaml_file")
100102
return (
101103
init_settings,

src/blueapi/service/interface.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
from blueapi.worker.task_worker import TaskWorker, TrackableTask
1616

1717
"""This module provides interface between web application and underlying Bluesky
18-
context and worker"""
18+
context and worker
19+
20+
the _CONFIG global variable is used by the subprocess only
21+
22+
"""
1923

2024

2125
_CONFIG: ApplicationConfig = ApplicationConfig()
@@ -26,6 +30,10 @@ def config() -> ApplicationConfig:
2630

2731

2832
def set_config(new_config: ApplicationConfig):
33+
"""
34+
This is a setter function that the main process uses
35+
to pass the config into the subprocess
36+
"""
2937
global _CONFIG
3038

3139
_CONFIG = new_config

0 commit comments

Comments
 (0)