storage.rst 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. .. This is a autogemerated documentation from python docstrings. It was generated using DStrings2Doc.
  2. .. module:: storage
  3. .. _storage:
  4. Module storage
  5. ==============
  6. .. py:class:: StorageError(Exception)
  7. Simple Storage Error Base Class
  8. .. py:class:: Storage(object)
  9. Simple Class to store Values and Throw an error if a value is retrieved that has not been stored before.
  10. .. py:method:: __init__(self, default=None)
  11. .. py:method:: setdefault(self, key, object)
  12. Call setdefault on the underlying dictionary and return the result
  13. :param key: the key to call setdefault with
  14. :param object: the object to call setdefault with
  15. :return: the return value of setdefault of the dictionary
  16. .. py:method:: __setattr__(self, key, value)
  17. .. py:method:: __getattr__(self, item)
  18. .. py:method:: get_board_specific_storage(board_id)
  19. Get the storage instance for a specific board
  20. :param board_id: the board to get the storage for
  21. :return: the instance of the storage for the given board
  22. .. py:class:: ThreadStorage(object)
  23. Wrapper for QThreads
  24. .. py:method:: __init__(self)
  25. .. py:method:: register(self, threaded_object)
  26. Register a class object to run in a QThread
  27. :param threaded_object: the class object
  28. .. py:method:: is_registered(self)
  29. Check if a class for this thread is registered.
  30. .. py:method:: __start(self)
  31. This will be registered to the QThread started signal and will call the actual start_method
  32. .. py:method:: start(self, method_to_run_in_thread)
  33. Move the class object to a QThread, connect the QThread.started signal to the given method of the
  34. class object
  35. :param method_to_run_in_thread: the method to start when starting the QThread
  36. .. py:method:: quit(self)
  37. Quit the thread class (if it has a method to quit)
  38. .. py:method:: stop(self)
  39. Call quit and wait to the underlying QThread
  40. .. py:method:: __getattr__(self, item)
  41. Get Attributes of the registered class object
  42. :param item: the item to get from the class object
  43. :return: the attribute of the class object
  44. .. py:method:: connect(self, signal, slot)
  45. Connect signals of the class object to the given slots
  46. :param signal: the signal
  47. :param slot: the slot
  48. .. py:method:: disconnect(self, *args)
  49. Disconnect the given signals
  50. :param args: the signals to disconnect
  51. .. py:method:: init(self, *args, **kwargs)
  52. call the threaded objects init method (not __init__) with the passed arguments