callbacks.rst 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. .. This is a autogemerated documentation from python docstrings. It was generated using DStrings2Doc.
  2. .. module:: callbacks
  3. .. _callbacks:
  4. Module callbacks
  5. ================
  6. .. py:class:: NoCallbackError(Exception)
  7. .. py:class:: CallbackExistsError(Exception)
  8. .. py:class:: CallbackHandler(QtCore.QObject)
  9. Handler for custom callbacks.
  10. It can handle synchronous callbacks as well as async callbacks (using pyqtSignals)
  11. .. py:method:: __init__(self)
  12. .. py:method:: callback(self, name, *args, **kwargs)
  13. Call all registered callback method for name
  14. This passes all additional arguments and keyword arguments down to the callbacks
  15. NOTE: all callbacks therefore need to accept the same number of arguments
  16. :param name: the name for which the callbacks are to be called
  17. :param args: arguments to be passed to the callbacks
  18. :param kwargs: keyword arguments to be passed to the callbacks
  19. .. py:method:: __async_callback_receiver(self, name, *args)
  20. Internal Method (Called when async callbacks are to be executed)
  21. .. py:method:: async_callback(self, name, *args, **kwargs)
  22. Perform a async callback (same as callback but through pyqtSignal and therefore allowed in threads)
  23. :param name: the name for which the callbacks are to be called
  24. :param args: arguments to be passed to the callbacks
  25. :param kwargs: keyword arguments to be passed to the callbacks
  26. .. py:method:: add_callback(self, name, callback)
  27. Register a callback for name
  28. :param name: the name to register against
  29. :param callback: the callback to register
  30. .. py:method:: delete_callback(self, name, callback)
  31. Delete a callback from name
  32. if no callback for name is left the whole group is deleted
  33. :param name: the name to delete the callback from
  34. :param callback: the callback to delete
  35. .. py:method:: delete_callback_class(self, name)
  36. Delete a whole callback class
  37. :param name: the name of the class