Karana.WebUI#

Classes and modules related to Web UI.

Classes#

Package Contents#

class Karana.WebUI.Server(port: SupportsInt = 8765)#
static canFindLocalClientExecutable() bool#

Check if the client executable can be found….

Returns:

Whether the client executable can be found

closeLocalClients() None#

Close all managed clients.

guessUrl() str#

Generate a URL to connect to the sever.

Note that this URL is a best guess from the point of view of the server. It may not reflect the publicly accessible URL for the server.

Returns:

The URL guess

launchLocalClient(*, silent: bool = True) None#

Spawn a managed electron client as a subprocess.

Parameter options:
  • Parameters struct for the local client.

onThread() bool#

Check whether the current thread is the io thread

Returns:

Whether the current thread is the io thread

port() int#

Get the port the server is bound to.

Returns:

The port number.

sync() None#

Wait for currently queued tasks to complete

waitForClients(clients: SupportsInt = 1, timeout: SupportsFloat = 0.0) None#

Wait for a given number of clients to connect.

Parameter clients:
  • Number of clients to wait for.

Parameter timeout:
  • Timeout in seconds, if positive