omnipy.hub.ui
| FUNCTION | DESCRIPTION |
|---|---|
detect_and_setup_user_interface |
Detects the user interface type based on the current environment and |
detect_dark_background |
|
detect_dark_terminal_background |
|
detect_display_color_system |
|
detect_ui_type |
|
display_jupyter_setup_note |
|
get_terminal_prompt_height |
Get the height of the terminal prompt (including blank lines) based on |
note_mime_bundle |
|
running_in_any_jupyter |
|
running_in_atty_terminal |
|
running_in_ipython_pycharm |
|
running_in_ipython_terminal |
|
running_in_jupyter_in_browser |
|
running_in_jupyter_in_pycharm |
|
running_in_pycharm_console |
|
setup_displayhook_if_plain_terminal |
Sets up the display hook for plain terminal environments to ensure that |
setup_jupyter_ui |
Sets up the Jupyter user interface by displaying the CSS styles and |
detect_and_setup_user_interface
detect_and_setup_user_interface(runtime: Runtime) -> None
Detects the user interface type based on the current environment and sets up the default configuration for that user interface type. This includes setting up color systems, display hooks, and CSS styles and other functionality as needed.
Source code in src/omnipy/hub/ui.py
detect_dark_background
detect_dark_background(ui_type: UserInterfaceType.Literals) -> bool
detect_dark_terminal_background
Source code in src/omnipy/hub/ui.py
detect_display_color_system
detect_display_color_system(
ui_type: SpecifiedUserInterfaceType.Literals,
) -> DisplayColorSystem.Literals
Source code in src/omnipy/hub/ui.py
detect_ui_type
detect_ui_type() -> AutoDetectableUserInterfaceType.Literals
Source code in src/omnipy/hub/ui.py
display_jupyter_setup_note
display_jupyter_setup_note(detected_ui_type: JupyterUserInterfaceType.Literals)
Source code in src/omnipy/hub/ui.py
get_terminal_prompt_height
get_terminal_prompt_height(ui_type: TerminalOutputUserInterfaceType.Literals) -> int
Get the height of the terminal prompt (including blank lines) based on the display type.
Source code in src/omnipy/hub/ui.py
note_mime_bundle
note_mime_bundle(
bullet: str,
html_content: str,
plain_text_content: str = "",
styling: str = "",
noscript: bool = False,
) -> dict[str, str]
Source code in src/omnipy/hub/ui.py
running_in_any_jupyter
running_in_atty_terminal
running_in_ipython_pycharm
running_in_ipython_terminal
running_in_jupyter_in_browser
running_in_jupyter_in_pycharm
running_in_pycharm_console
setup_displayhook_if_plain_terminal
setup_displayhook_if_plain_terminal(ui_type: TerminalOutputUserInterfaceType.Literals) -> None
Sets up the display hook for plain terminal environments to ensure that Model instances, Datasets, and ConfigBase objects are displayed using Omnipy's syntax highlighting and formatting.
Source code in src/omnipy/hub/ui.py
setup_jupyter_ui
Sets up the Jupyter user interface by displaying the CSS styles and adding hidden reactive elements for Jupyter Notebook or JupyterLab. Hidden reactive elements include:
- A reactive element monitoring background color changes to detect changes in theme (dark/light) - A reactive element monitoring the available display size to auto-scale Omnipy outputs accordingly.
This function is typically called in a Jupyter environment to ensure proper display and interaction with Omnipy components.
Source code in src/omnipy/hub/ui.py
291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 | |