PyformsManager

Note

Located in the pyforms.js file.

class PyformsManager()

PyformsManager is the class than manages all the pyforms client side interaction.

PyformsManager.add_app(app)

Add an app to the manager.

Arguments
PyformsManager.checker_loop()

check what it do

PyformsManager.close_layout_place(layout_position)

Close a layout.

Arguments
  • layout_position (int) – Layout id.

PyformsManager.find_app(app_id)

Search an app using the id.

Arguments
  • app_id (string) – BaseWidget id.

PyformsManager.find_control(control_id)

Search for a control by its id.

Arguments
  • control_id (string) – Control id.

PyformsManager.garbage_collector()

Check if applications are still in use, if not remove them

PyformsManager.open_application(app_data)

Open an application.

Arguments
  • app_data (object) – App data.

PyformsManager.query_server(basewidget, data2send, show_loading)

Contact the server to submit and receive updates.

Arguments
  • basewidget (BaseWidget) – BaseWidget object.

  • data2send (object) – Object with the data to send.

  • show_loading (bool) – Flag to activate the app loading (optional).

PyformsManager.register_checkloop(check_event)

Check what it does

PyformsManager.register_layout_place(place_id, place_generator, place_activator, place_closer)

Register a new layout for the applications.

Arguments
  • place_id (string) – App id.

  • place_generator (function) – Function that will generate the html container for the applications.

  • place_activator (function) – Function to active the layout when it exists.

  • place_closer (function) – Function to destroy the layout.

PyformsManager.remove_app(app_id, app_index)

Remove an app from the manager. If the app_index parameter is not defined it will search for the index using the app_id parameter.

Arguments
  • app_id (string) – BaseWidget id.

  • app_index (int) – BaseWidget index (optional).

PyformsManager.split_id(control_id)

Parse the control id

Arguments
  • control_id (string) – Control id.

Returns

list(str) – [widget_id, control_name]

Other functions

Note

Located in the pyforms-hub.js file.

error_msg(msg)

Function called to show a message. This function can be overriden.

Arguments
  • msg (string) – Message.

run_application(application, constructor_params, method_params)

Function called to execute a pyforms application.

Arguments
  • application (string) – Full python module path of the Widget to be executed.

  • constructor_params (object) – Widget parameters.

  • method_params (object) – Functions and parameters to be executed after the Widget initialization.

pyforms_checkhash()

Function called to check if there is a hash command to be executed. Url hash can be used to open an application.