iblrig.gui.tools.AlyxObject
- class iblrig.gui.tools.AlyxObject[source]
A class to manage user authentication with an AlyxClient.
This class provides methods to log in and log out users, emitting signals to indicate changes in authentication status.
- Parameters:
alyxUrl (
str
, optional) – The base URL for the Alyx API. If provided, an AlyxClient will be created.alyxClient (
AlyxClient
, optional) – An existing AlyxClient instance. If provided, it will be used for authentication.
- statusChanged
Emitted when the login status changes (logged in or out). The signal carries a boolean indicating the new status.
- Type:
pyqtSignal
- loggedIn
Emitted when a user logs in. The signal carries a string representing the username.
- Type:
pyqtSignal
- loggedOut
Emitted when a user logs out. The signal carries a string representing the username.
- Type:
pyqtSignal
- loginFailed
Emitted when a login attempt fails. The signal carries a string representing the username.
- Type:
pyqtSignal
- __init__(*args, alyxUrl=None, alyxClient=None, **kwargs)[source]
Initializes the AlyxObject.
- Parameters:
- Parameters:
alyxUrl (str | None)
alyxClient (AlyxClient | None)
- logIn(username, password=None, cacheToken=False)[source]
Logs in a user with the provided username and password.
Emits the loggedIn and statusChanged signals if the logout is successful, and the loginFailed signal otherwise.
- Parameters:
- Returns:
True if the login was successful, False otherwise.
- Return type:
- Parameters:
- logOut()[source]
Logs out the currently logged-in user.
Emits the loggedOut and statusChanged signals if the logout is successful.
- Return type:
None
- property isLoggedIn
Indicates whether a user is currently logged in.
- loggedIn
str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- loggedOut
str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- loginFailed
str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- statusChanged
str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name