Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /DiamondLightSource_python-murfey /src /murfey /server /api /hub.py
| from logging import getLogger | |
| from typing import List | |
| from fastapi import APIRouter | |
| from fastapi.responses import FileResponse | |
| from pydantic import BaseModel | |
| from murfey.util.config import get_machine_config | |
| logger = getLogger("murfey.server.api.hub") | |
| config = get_machine_config() | |
| router = APIRouter(tags=["Murfey Hub"]) | |
| class InstrumentInfo(BaseModel): | |
| instrument_name: str | |
| display_name: str | |
| instrument_url: str | |
| def get_instrument_info() -> List[InstrumentInfo]: | |
| return [ | |
| InstrumentInfo( | |
| instrument_name=k, display_name=v.display_name, instrument_url=v.murfey_url | |
| ) | |
| for k, v in config.items() | |
| ] | |
| def get_instrument_image(instrument_name: str) -> FileResponse: | |
| if config.get(instrument_name): | |
| return FileResponse(config[instrument_name].image_path) | |
| return FileResponse() | |
Xet Storage Details
- Size:
- 933 Bytes
- Xet hash:
- 6951f2a649010d482cd321318b4f21cf033c9b469021e67b39ba2b0f2f30c1eb
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.