Source code for frame_cli.show

"""Module for `frame show` commands."""

from rich.console import Console
from rich.panel import Panel

from .utils import retrieve_component_info, retrieve_model_info










[docs] def show_remote_model(name: str) -> None: """Show information about a remote hybrid model.""" info = retrieve_model_info(name) if info is None: return console = Console() console.print("") console.print(info["name"], style="bold underline") console.print("Hybrid model") console.print("") console.print(", ".join(info["contributors"])) console.print("") console.print(info["description"]) console.print("") print_keywords(console, info["keywords"], style="white on red") console.print("") if "created" in info and info["created"]: console.print(f"📅 Created on: {info['created']}") if "license" in info and info["license"]: console.print(f"📜 License: {info['license']}") console.print("") print_pull_command(console, f"frame pull model {name}")
[docs] def show_remote_component(name: str) -> None: """Show information about a remote component.""" info, component_type = retrieve_component_info(name) if info is None: return console = Console() console.print("") console.print(info["name"], style="bold underline") console.print(f"{component_type} component") console.print("") console.print(", ".join(info["contributors"])) console.print("") console.print(info["description"]) console.print("") print_keywords( console, info["keywords"], style="white on blue" if component_type == "Physics-based" else "white on cyan" ) console.print("") if "created" in info and info["created"]: console.print(f"📅 Created on: {info['created']}") if "license" in info and info["license"]: console.print(f"📜 License: {info['license']}") console.print("") print_pull_command(console, f"frame pull component {name}")