bauiv1lib.cloudui package

Functionality for interacting with cloud-ui from the client.

class bauiv1lib.cloudui.CloudUIController[source]

Bases: object

Manages interactions between CloudUI clients and servers.

Can include logic to handle all requests locally or can submit them to be handled by some server or can do some combination thereof.

create_window(request: CloudUIRequest) CloudUIWindow[source]

Create a window for some initial request.

fulfill_request(request: CloudUIRequest) CloudUIResponse[source]

Override this to handle request fulfillment.

Exceptions should be raised for any errors; the base class will handle converting those to a Response.

Be aware that this will always be called in a background thread.

class bauiv1lib.cloudui.CloudUIPagePrep(page: Page, uiscale: UIScale, scroll_width: float, idprefix: str, *, immediate: bool = False)[source]

Bases: object

Preps a page.

Generally does its work in a background thread.

instantiate(scrollwidget: Widget, backbutton: Widget, windowbackbutton: Widget | None) Widget[source]

Create a UI using prepped data.

class bauiv1lib.cloudui.CloudUIWindow(state: State | None, *, transition: str | None = 'in_right', origin_widget: bui.Widget | None = None, auxiliary_style: bool = True)[source]

Bases: MainWindow

UI provided by the cloud.

class State(controller: CloudUIController, page: bacommon.cloudui.v1.Page)[source]

Bases: object

Final state window can be set to show.

controller: CloudUIController
page: bacommon.cloudui.v1.Page
get_main_window_shared_state_id() str | None[source]

Provide a custom id for window shared state.

Unlike MainWindowState, which is used to save and restore a single main-window instance, shared-state is intended to hold values that can apply to multiple instances of a window.

By default, shared state uses the window class as an index (so is shared by all windows of the same class), but this method can be overridden to provide more distinct states. For example, a store-page main-window class might want to keep distinct states for different sub-pages it can display instead of having a single state for the whole class.

Note that shared state only persists for the current run of the app.

get_main_window_state() MainWindowState[source]

Return a WindowState to recreate this specific window.

Used to gracefully return to a window from another window or ui system.

main_window_should_preserve_selection() bool[source]

Whether this window should auto-save/restore selection.

If enabled, selection will be stored in the window’s shared state. See get_main_window_shared_state_id() for more info about main-window shared-state.

The default value of None results in a warning to explicitly override this (as the implicit default will change from False to True after api 9 support ends).

set_state(state: State, immediate: bool = False) None[source]

Set a final state (error or page contents).

This state may be instantly restored if the window is recreated (depending on cache lifespan/etc.)

bauiv1lib.cloudui.show_test_cloud_ui_window() None[source]

Bust out a cloud-ui window.