Repository: Avaiga/taipy
File: taipy/gui/gui.py (Python)

Code before:

        - *state*: the `State^` instance of the caller.
        """
        self.on_page_load: t.Optional[t.Callable] = None
        """This callback is invoked just before the page content is sent to the front-end.

        It defaults to the `on_page_load()` global function defined in the Python
        application. If there is no such function, page loads will not trigger
        anything.<br/>

        The signature of the *on_page_load* callback function must be:
        - *state*: the `State^` instance of the caller.
        - *page_name*: the name of the page that is being loaded.
        """
        self.on_navigate: t.Optional[t.Callable] = None
        """The function that is called when a page is requested.

        It defaults to the `on_navigate()` global function defined in the Python
        application. If there is no such function, page requests will not trigger
        anything.<br/>

        The signature of the *on_navigate* callback function must be:

        - *state*: the `State^` instance of the caller.
        - *page_name*: the name of the page the user is navigating to.
        - *params* (Optional): the query arguments provided in the URL.

        The *on_navigate* callback function must return the name of the page the user should be
        directed to.
        """
        self.on_exception: t.Optional[t.Callable] = None
        """The function that is called an exception occurs on user code.

        It defaults to the `on_exception()` global function defined in the Python
        application. If there is no such function, exceptions will not trigger
        anything.<br/>

        The signature of the *on_exception* callback function must be:

        - *state*: the `State^` instance of the caller.
        - *function_name*: the name of the function that raised the exception.
        - *exception*: the exception object that was raised.
        """
        self.on_status: t.Optional[t.Callable] = None
        """The function that is called when the status page is shown.

        It defaults to the `on_status()` global function defined in the Python
        application. If there is no such function, status page content shows only the status of the
        server.<br/>

        The signature of the *on_status* callback function must be:

Review comment (suggestion):
```suggestion
        - *params* (Optional): the query parameters provided in the URL.
```

Code after:

        - *state*: the `State^` instance of the caller.
        """
        self.on_page_load: t.Optional[t.Callable] = None
        """This callback is invoked just before the page content is sent to the front-end.

        It defaults to the `on_page_load()` global function defined in the Python
        application. If there is no such function, page loads will not trigger
        anything.<br/>

        The signature of the *on_page_load* callback function must be:
        - *state*: the `State^` instance of the caller.
        - *page_name*: the name of the page that is being loaded.
        """
        self.on_navigate: t.Optional[t.Callable] = None
        """The function that is called when a page is requested.

        It defaults to the `on_navigate()` global function defined in the Python
        application. If there is no such function, page requests will not trigger
        anything.<br/>

        The signature of the *on_navigate* callback function must be:

        - *state*: the `State^` instance of the caller.
        - *page_name*: the name of the page the user is navigating to.
        - *params* (Optional): the query parameters provided in the URL.

        The *on_navigate* callback function must return the name of the page the user should be
        directed to.
        """
        self.on_exception: t.Optional[t.Callable] = None
        """The function that is called an exception occurs on user code.

        It defaults to the `on_exception()` global function defined in the Python
        application. If there is no such function, exceptions will not trigger
        anything.<br/>

        The signature of the *on_exception* callback function must be:

        - *state*: the `State^` instance of the caller.
        - *function_name*: the name of the function that raised the exception.
        - *exception*: the exception object that was raised.
        """
        self.on_status: t.Optional[t.Callable] = None
        """The function that is called when the status page is shown.

        It defaults to the `on_status()` global function defined in the Python
        application. If there is no such function, status page content shows only the status of the
        server.<br/>

        The signature of the *on_status* callback function must be: