composeui.core.client¶
Where the app runs for its user, and who the user is (ClientCapabilities, User).
The same app may run on the user’s own computer (Qt, Textual, a local web server) or on
another one that the user reaches through a browser or a terminal. MainView.open_folder,
open_file, open_url and display_path adapt to it. An app reads MainView.client only
to hide or change a control, such as an “Open folder” button that can’t work. Behind a
login proxy, on the web, MainView.user says who the user is.
- class composeui.core.client.ClientCapabilities[source]¶
Bases:
objectWhat the app can do for its user, from where it runs for them.
Each backend sets it: Qt runs on the user’s computer (
local), and so does Textual, unless it runs over SSH ortextual-serve, where the app can’t reach the user’s desktop. The web serves users on other computers (served), unlessWebSettings(client=ClientCapabilities.local())says that the server runs on the user’s own computer, outside a container: nothing in a request can tell.Whether a path in the app is the same path for the user: on their computer, or in the shell that runs a terminal app.
- can_open_on_desktop: bool¶
Whether
MainView.open_folderandopen_fileopen on the user’s desktop: in its file manager or the file’s app.
- multi_user: bool¶
Whether several people may use this process at once, as on a web server. It says how the app is deployed, not who the user is.
- classmethod local()[source]¶
Get the capabilities of an app on its user’s own computer: Qt’s.
- Return type:
- class composeui.core.client.User[source]¶
Bases:
objectThe user whom a login proxy let in, on the web (
MainView.user).The proxy names them in the headers of each request (
WebSettings.user_header,user_name_header,user_email_header). Onlyidtells users apart: the name and the email are for the app to show, and None when the proxy gives none. Never grant access by them: a user can often change both at the identity provider, and it may not have checked the email.