Skip to content

Commit

Permalink
for visr allow overriding the pv
Browse files Browse the repository at this point in the history
  • Loading branch information
stan-dot committed Sep 18, 2024
1 parent 92e3edb commit 024aad9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/dodal/beamlines/b01_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from dodal.log import set_beamline as set_log_beamline
from dodal.utils import get_beamline_name

BL = get_beamline_name("c01") # noqa: F821
BL = get_beamline_name("c01", force_default=True) # noqa: F821
set_log_beamline(BL)
set_utils_beamline(BL)

Expand Down
5 changes: 4 additions & 1 deletion src/dodal/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@
AnyDeviceFactory: TypeAlias = V1DeviceFactory | V2DeviceFactory


def get_beamline_name(default: str) -> str:
def get_beamline_name(default: str, force_default: bool = False) -> str:
if force_default:
return default
return environ.get("BEAMLINE") or default


Expand Down Expand Up @@ -149,6 +151,7 @@ def make_all_devices(
"""
if isinstance(module, str) or module is None:
module = import_module(module or __name__)
print(module.BL)
factories = collect_factories(module, include_skipped)
devices: tuple[dict[str, AnyDevice], dict[str, Exception]] = invoke_factories(
factories, **kwargs
Expand Down

0 comments on commit 024aad9

Please sign in to comment.