bec-widgets 0.75.0__tar.gz → 0.76.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/CHANGELOG.md +20 -16
  2. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/PKG-INFO +1 -1
  3. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/cli/generate_cli.py +21 -0
  4. bec_widgets-0.76.1/bec_widgets/utils/generate_designer_plugin.py +148 -0
  5. bec_widgets-0.76.1/bec_widgets/utils/plugin_templates/plugin.template +54 -0
  6. bec_widgets-0.76.1/bec_widgets/utils/plugin_templates/register.template +15 -0
  7. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/ring_progress_bar/ring_progress_bar.py +1 -1
  8. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/text_box/text_box.py +1 -1
  9. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/website/website.py +1 -1
  10. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/pyproject.toml +1 -1
  11. bec_widgets-0.76.1/tests/unit_tests/test_generate_plugin.py +155 -0
  12. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/.git_hooks/pre-commit +0 -0
  13. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/.gitignore +0 -0
  14. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/.gitlab/issue_templates/bug_report_template.md +0 -0
  15. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/.gitlab/issue_templates/documentation_update_template.md +0 -0
  16. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/.gitlab/issue_templates/feature_request_template.md +0 -0
  17. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/.gitlab/merge_request_templates/default.md +0 -0
  18. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/.gitlab-ci.yml +0 -0
  19. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/.pylintrc +0 -0
  20. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/.readthedocs.yaml +0 -0
  21. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/LICENSE +0 -0
  22. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/README.md +0 -0
  23. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/__init__.py +0 -0
  24. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/assets/bec_widgets_icon.png +0 -0
  25. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/assets/terminal_icon.png +0 -0
  26. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/cli/__init__.py +0 -0
  27. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/cli/auto_updates.py +0 -0
  28. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/cli/client.py +0 -0
  29. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/cli/client_utils.py +0 -0
  30. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/cli/rpc_register.py +0 -0
  31. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/cli/rpc_wigdet_handler.py +0 -0
  32. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/cli/server.py +0 -0
  33. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/examples/__init__.py +0 -0
  34. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/examples/jupyter_console/__init__.py +0 -0
  35. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/examples/jupyter_console/jupyter_console_window.py +0 -0
  36. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/examples/jupyter_console/jupyter_console_window.ui +0 -0
  37. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/examples/motor_movement/__init__.py +0 -0
  38. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/examples/motor_movement/motor_control_compilations.py +0 -0
  39. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/examples/motor_movement/motor_controller.ui +0 -0
  40. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/examples/plugin_example_pyside/__init__.py +0 -0
  41. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/examples/plugin_example_pyside/main.py +0 -0
  42. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/examples/plugin_example_pyside/registertictactoe.py +0 -0
  43. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/examples/plugin_example_pyside/taskmenuextension.pyproject +0 -0
  44. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/examples/plugin_example_pyside/tictactoe.py +0 -0
  45. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/examples/plugin_example_pyside/tictactoeplugin.py +0 -0
  46. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/examples/plugin_example_pyside/tictactoetaskmenu.py +0 -0
  47. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/utils/__init__.py +0 -0
  48. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/utils/bec_connector.py +0 -0
  49. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/utils/bec_designer.py +0 -0
  50. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/utils/bec_dispatcher.py +0 -0
  51. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/utils/bec_table.py +0 -0
  52. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/utils/colors.py +0 -0
  53. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/utils/container_utils.py +0 -0
  54. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/utils/crosshair.py +0 -0
  55. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/utils/entry_validator.py +0 -0
  56. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/utils/layout_manager.py +0 -0
  57. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/utils/plugin_utils.py +0 -0
  58. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/utils/rpc_decorator.py +0 -0
  59. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/utils/thread_checker.py +0 -0
  60. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/utils/ui_loader.py +0 -0
  61. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/utils/validator_delegate.py +0 -0
  62. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/utils/widget_io.py +0 -0
  63. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/utils/yaml_dialog.py +0 -0
  64. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/__init__.py +0 -0
  65. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/bec_queue/__init__.py +0 -0
  66. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/bec_queue/bec_queue.py +0 -0
  67. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/bec_queue/bec_queue.pyproject +0 -0
  68. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/bec_queue/bec_queue_plugin.py +0 -0
  69. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/bec_queue/register_bec_queue.py +0 -0
  70. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/bec_status_box/__init__.py +0 -0
  71. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/bec_status_box/bec_status_box.py +0 -0
  72. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/bec_status_box/status_item.py +0 -0
  73. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/buttons/__init__.py +0 -0
  74. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/buttons/stop_button/__init__.py +0 -0
  75. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/buttons/stop_button/stop_button.py +0 -0
  76. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/device_inputs/__init__.py +0 -0
  77. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/device_inputs/device_combobox/__init__.py +0 -0
  78. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/device_inputs/device_combobox/device_combobox.py +0 -0
  79. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/device_inputs/device_combobox/device_combobox.pyproject +0 -0
  80. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/device_inputs/device_combobox/device_combobox_plugin.py +0 -0
  81. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/device_inputs/device_combobox/launch_device_combobox.py +0 -0
  82. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/device_inputs/device_combobox/register_device_combobox.py +0 -0
  83. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/device_inputs/device_input_base.py +0 -0
  84. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/device_inputs/device_line_edit/__init__.py +0 -0
  85. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/device_inputs/device_line_edit/device_line_edit.py +0 -0
  86. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/device_inputs/device_line_edit/device_line_edit.pyproject +0 -0
  87. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/device_inputs/device_line_edit/device_line_edit_plugin.py +0 -0
  88. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/device_inputs/device_line_edit/launch_device_line_edit.py +0 -0
  89. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/device_inputs/device_line_edit/register_device_line_edit.py +0 -0
  90. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/dock/__init__.py +0 -0
  91. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/dock/dock.py +0 -0
  92. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/dock/dock_area.py +0 -0
  93. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/figure/__init__.py +0 -0
  94. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/figure/figure.py +0 -0
  95. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/figure/plots/__init__.py +0 -0
  96. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/figure/plots/image/__init__.py +0 -0
  97. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/figure/plots/image/image.py +0 -0
  98. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/figure/plots/image/image_item.py +0 -0
  99. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/figure/plots/image/image_processor.py +0 -0
  100. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/figure/plots/motor_map/__init__.py +0 -0
  101. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/figure/plots/motor_map/motor_map.py +0 -0
  102. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/figure/plots/plot_base.py +0 -0
  103. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/figure/plots/waveform/__init__.py +0 -0
  104. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/figure/plots/waveform/waveform.py +0 -0
  105. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/figure/plots/waveform/waveform_curve.py +0 -0
  106. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/jupyter_console/__init__.py +0 -0
  107. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/jupyter_console/jupyter_console.py +0 -0
  108. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/motor_control/__init__.py +0 -0
  109. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/motor_control/motor_control.py +0 -0
  110. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/motor_control/motor_table/__init__.py +0 -0
  111. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/motor_control/motor_table/motor_table.py +0 -0
  112. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/motor_control/motor_table/motor_table.ui +0 -0
  113. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/motor_control/movement_absolute/__init__.py +0 -0
  114. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/motor_control/movement_absolute/movement_absolute.py +0 -0
  115. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/motor_control/movement_absolute/movement_absolute.ui +0 -0
  116. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/motor_control/movement_relative/__init__.py +0 -0
  117. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/motor_control/movement_relative/movement_relative.py +0 -0
  118. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/motor_control/movement_relative/movement_relative.ui +0 -0
  119. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/motor_control/selection/__init__.py +0 -0
  120. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/motor_control/selection/selection.py +0 -0
  121. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/motor_control/selection/selection.ui +0 -0
  122. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/ring_progress_bar/__init__.py +0 -0
  123. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/ring_progress_bar/ring.py +0 -0
  124. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/scan_control/__init__.py +0 -0
  125. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/scan_control/scan_control.py +0 -0
  126. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/scan_control/scan_group_box.py +0 -0
  127. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/text_box/__init__.py +0 -0
  128. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/toolbar/__init__.py +0 -0
  129. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/toolbar/toolbar.py +0 -0
  130. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/vscode/__init__.py +0 -0
  131. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/vscode/vscode.py +0 -0
  132. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/bec_widgets/widgets/website/__init__.py +0 -0
  133. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/Makefile +0 -0
  134. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/_static/custom.css +0 -0
  135. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/_templates/custom-class-template.rst +0 -0
  136. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/_templates/custom-module-template.rst +0 -0
  137. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/api_reference/api_reference.md +0 -0
  138. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/assets/apps_48dp.svg +0 -0
  139. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/assets/display_settings_48dp.svg +0 -0
  140. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/assets/index_api.svg +0 -0
  141. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/assets/index_contribute.svg +0 -0
  142. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/assets/index_getting_started.svg +0 -0
  143. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/assets/index_user_guide.svg +0 -0
  144. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/assets/rocket_launch_48dp.svg +0 -0
  145. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/conf.py +0 -0
  146. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/developer/developer.md +0 -0
  147. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/developer/getting_started/development.md +0 -0
  148. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/developer/getting_started/getting_started.md +0 -0
  149. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/developer/widgets/widgets.md +0 -0
  150. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/index.md +0 -0
  151. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/introduction/introduction.md +0 -0
  152. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/make.bat +0 -0
  153. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/requirements.txt +0 -0
  154. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/user/api_reference/api_reference.md +0 -0
  155. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/user/applications/applications.md +0 -0
  156. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/user/customisation.md +0 -0
  157. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/user/getting_started/BECDockArea.png +0 -0
  158. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/user/getting_started/auto_updates.md +0 -0
  159. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/user/getting_started/getting_started.md +0 -0
  160. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/user/getting_started/gui_complex_gui.gif +0 -0
  161. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/user/getting_started/installation.md +0 -0
  162. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/user/getting_started/quick_start.md +0 -0
  163. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/user/user.md +0 -0
  164. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/user/widgets/BECFigure.png +0 -0
  165. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/user/widgets/bec_figure.md +0 -0
  166. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/user/widgets/bec_figure_dap.gif +0 -0
  167. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/user/widgets/bec_status_box.gif +0 -0
  168. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/user/widgets/bec_status_box.md +0 -0
  169. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/user/widgets/buttons.md +0 -0
  170. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/user/widgets/image_plot.gif +0 -0
  171. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/user/widgets/motor.gif +0 -0
  172. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/user/widgets/progress_bar.gif +0 -0
  173. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/user/widgets/ring_progress_bar.md +0 -0
  174. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/user/widgets/scan_control.gif +0 -0
  175. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/user/widgets/scan_control.md +0 -0
  176. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/user/widgets/scatter_2D.gif +0 -0
  177. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/user/widgets/text_box.md +0 -0
  178. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/user/widgets/w1D.gif +0 -0
  179. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/user/widgets/website.md +0 -0
  180. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/docs/user/widgets/widgets.md +0 -0
  181. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/__init__.py +0 -0
  182. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/end-2-end/__init__.py +0 -0
  183. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/end-2-end/conftest.py +0 -0
  184. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/end-2-end/test_bec_dock_rpc_e2e.py +0 -0
  185. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/end-2-end/test_bec_figure_rpc_e2e.py +0 -0
  186. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/end-2-end/test_rpc_register_e2e.py +0 -0
  187. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/end-2-end/test_scan_control_e2e.py +0 -0
  188. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/__init__.py +0 -0
  189. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/client_mocks.py +0 -0
  190. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/conftest.py +0 -0
  191. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_bec_connector.py +0 -0
  192. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_bec_dispatcher.py +0 -0
  193. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_bec_dock.py +0 -0
  194. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_bec_figure.py +0 -0
  195. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_bec_image.py +0 -0
  196. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_bec_motor_map.py +0 -0
  197. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_bec_queue.py +0 -0
  198. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_bec_status_box.py +0 -0
  199. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_client_utils.py +0 -0
  200. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_color_validation.py +0 -0
  201. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_configs/config_device.yaml +0 -0
  202. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_configs/config_device_no_entry.yaml +0 -0
  203. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_configs/config_scan.yaml +0 -0
  204. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_crosshair.py +0 -0
  205. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_device_input_base.py +0 -0
  206. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_device_input_widgets.py +0 -0
  207. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_generate_cli_client.py +0 -0
  208. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_motor_control.py +0 -0
  209. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_msgs/__init__.py +0 -0
  210. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_msgs/available_scans_message.py +0 -0
  211. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_plot_base.py +0 -0
  212. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_plugin_utils.py +0 -0
  213. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_ring_progress_bar.py +0 -0
  214. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_rpc_register.py +0 -0
  215. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_rpc_widget_handler.py +0 -0
  216. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_scan_control.py +0 -0
  217. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_scan_control_group_box.py +0 -0
  218. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_stop_button.py +0 -0
  219. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_text_box_widget.py +0 -0
  220. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_vscode_widget.py +0 -0
  221. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_waveform1d.py +0 -0
  222. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_website_widget.py +0 -0
  223. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_widget_io.py +0 -0
  224. {bec_widgets-0.75.0 → bec_widgets-0.76.1}/tests/unit_tests/test_yaml_dialog.py +0 -0
@@ -1,5 +1,25 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v0.76.1 (2024-06-29)
4
+
5
+ ### Fix
6
+
7
+ * fix(plugins): fixes and tests for auto-gen plugins ([`c42511d`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/c42511dd44cc13577e108a6cef3166376e594f54))
8
+
9
+ ## v0.76.0 (2024-06-28)
10
+
11
+ ### Feature
12
+
13
+ * feat(designer): added support for creating designer plugins automatically ([`c1dd0ee`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/c1dd0ee1906dba1f2e2ae9ce40a84d55c26a1cce))
14
+
15
+ ### Fix
16
+
17
+ * fix: fixed qwidget inheritance for ring progress bar ([`0610d2f`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/0610d2f9f027f8659e7149f2dfbb316ff30e337d))
18
+
19
+ ### Unknown
20
+
21
+ * fix:parent set as first kwarg TextBox and WebsiteWidget ([`a45c407`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/a45c4075684b93bfdcee03e5a416b84f61d3bc6f))
22
+
3
23
  ## v0.75.0 (2024-06-26)
4
24
 
5
25
  ### Feature
@@ -110,10 +130,6 @@
110
130
 
111
131
  ## v0.71.0 (2024-06-23)
112
132
 
113
- ### Feature
114
-
115
- * feat(scan_group_box): scan box for args and kwargs separated from ScanControlGUI code ([`d8cf441`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/d8cf44134c30063e586771f9068947fef7a306d1))
116
-
117
133
  ### Fix
118
134
 
119
135
  * fix(cleanup): cleanup added to device_input widgets and scan_control ([`8badb6a`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/8badb6adc1d003dbf0b2b1a800c34821f3fc9aa3))
@@ -126,16 +142,6 @@
126
142
 
127
143
  * fix(scan_control): only scans with defined gui_config are allowed ([`6dff187`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/6dff1879c4178df0f8ebfd35101acdebb028d572))
128
144
 
129
- * fix(WidgetIO): find handlers within base classes ([`ca85638`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/ca856384f380dabf28d43f1cd48511af784c035b))
130
-
131
- * fix(scan_control): adapted widget to scan BEC gui config ([`8b822e0`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/8b822e0fa8e28f080b9a4bf81948a7280a4c07bf))
132
-
133
- * fix(scan_control): scan_control.py combatible with the newest BEC versions, test disabled ([`67d398c`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/67d398caf74e08ab25a70cc5d85a5f0c2de8212d))
134
-
135
- ### Refactor
136
-
137
- * refactor(device_line_edit): renamed default_device to default ([`4e2c9df`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/4e2c9df6a4979d935285fd7eba17fd7fd455a35c))
138
-
139
145
  ### Test
140
146
 
141
147
  * test(scan_control): tests added ([`56e74a0`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/56e74a0e7da72d18e89bc30d1896dbf9ef97cd6b))
@@ -149,5 +155,3 @@
149
155
  * fix(device_line_edit):SizePolicy fixed for 100 horizontal ([`21d20e0`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/21d20e0fc78e9a3853abe802733388cce119ce20))
150
156
 
151
157
  * tests WIP ([`c09644b`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/c09644b29ddb291c91dc58bcd6ebf02ff45cab36))
152
-
153
- ## v0.70.0 (2024-06-21)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: bec_widgets
3
- Version: 0.75.0
3
+ Version: 0.76.1
4
4
  Summary: BEC Widgets
5
5
  Project-URL: Bug Tracker, https://gitlab.psi.ch/bec/bec_widgets/issues
6
6
  Project-URL: Homepage, https://gitlab.psi.ch/bec/bec_widgets
@@ -10,6 +10,7 @@ from typing import Literal
10
10
  import black
11
11
  import isort
12
12
 
13
+ from bec_widgets.utils.generate_designer_plugin import DesignerPluginGenerator
13
14
  from bec_widgets.utils.plugin_utils import get_rpc_classes
14
15
 
15
16
  if sys.version_info >= (3, 11):
@@ -161,6 +162,26 @@ def main():
161
162
  generator.generate_client(rpc_classes)
162
163
  generator.write(client_path)
163
164
 
165
+ for cls in rpc_classes["top_level_classes"]:
166
+ plugin = DesignerPluginGenerator(cls)
167
+ if not hasattr(plugin, "info"):
168
+ continue
169
+
170
+ # if the class directory already has a register, plugin and pyproject file, skip
171
+ if os.path.exists(
172
+ os.path.join(plugin.info.base_path, f"register_{plugin.info.plugin_name_snake}.py")
173
+ ):
174
+ continue
175
+ if os.path.exists(
176
+ os.path.join(plugin.info.base_path, f"{plugin.info.plugin_name_snake}_plugin.py")
177
+ ):
178
+ continue
179
+ if os.path.exists(
180
+ os.path.join(plugin.info.base_path, f"{plugin.info.plugin_name_snake}.pyproject")
181
+ ):
182
+ continue
183
+ plugin.run()
184
+
164
185
 
165
186
  if __name__ == "__main__": # pragma: no cover
166
187
  sys.argv = ["generate_cli.py", "--core"]
@@ -0,0 +1,148 @@
1
+ import inspect
2
+ import os
3
+ import re
4
+
5
+ from qtpy.QtCore import QObject
6
+
7
+ EXCLUDED_PLUGINS = ["BECConnector", "BECDockArea", "BECDock"]
8
+
9
+
10
+ class DesignerPluginInfo:
11
+ def __init__(self, plugin_class):
12
+ self.plugin_class = plugin_class
13
+ self.plugin_name_pascal = plugin_class.__name__
14
+ self.plugin_name_snake = self.pascal_to_snake(self.plugin_name_pascal)
15
+ self.widget_import = f"from {plugin_class.__module__} import {self.plugin_name_pascal}"
16
+ plugin_module = (
17
+ ".".join(plugin_class.__module__.split(".")[:-1]) + f".{self.plugin_name_snake}_plugin"
18
+ )
19
+ self.plugin_import = f"from {plugin_module} import {self.plugin_name_pascal}Plugin"
20
+
21
+ # first sentence / line of the docstring is used as tooltip
22
+ self.plugin_tooltip = (
23
+ plugin_class.__doc__.split("\n")[0].strip().replace('"', "'")
24
+ if plugin_class.__doc__
25
+ else self.plugin_name_pascal
26
+ )
27
+
28
+ self.base_path = os.path.dirname(inspect.getfile(plugin_class))
29
+
30
+ @staticmethod
31
+ def pascal_to_snake(name: str) -> str:
32
+ """
33
+ Convert PascalCase to snake_case.
34
+
35
+ Args:
36
+ name (str): The name to be converted.
37
+
38
+ Returns:
39
+ str: The converted name.
40
+ """
41
+ s1 = re.sub(r"([a-z0-9])([A-Z])", r"\1_\2", name)
42
+ s2 = re.sub(r"([A-Z]+)([A-Z][a-z])", r"\1_\2", s1)
43
+ return s2.lower()
44
+
45
+
46
+ class DesignerPluginGenerator:
47
+ def __init__(self, widget: type):
48
+ self._excluded = False
49
+ self.widget = widget
50
+ self.info = DesignerPluginInfo(widget)
51
+ if widget.__name__ in EXCLUDED_PLUGINS:
52
+
53
+ self._excluded = True
54
+ return
55
+
56
+ self.templates = {}
57
+ self.template_path = os.path.join(
58
+ os.path.dirname(os.path.abspath(__file__)), "plugin_templates"
59
+ )
60
+
61
+ def run(self):
62
+ if self._excluded:
63
+ print(f"Plugin {self.widget.__name__} is excluded from generation.")
64
+ return
65
+ self._check_class_validity()
66
+ self._load_templates()
67
+ self._write_templates()
68
+
69
+ def _check_class_validity(self):
70
+
71
+ # Check if the widget is a QWidget subclass
72
+ if not issubclass(self.widget, QObject):
73
+ return
74
+
75
+ # Check if the widget class has parent as the first argument. This is a strict requirement of Qt!
76
+ signature = list(inspect.signature(self.widget.__init__).parameters.values())
77
+ if len(signature) == 1 or signature[1].name != "parent":
78
+ raise ValueError(
79
+ f"Widget class {self.widget.__name__} must have parent as the first argument."
80
+ )
81
+
82
+ base_cls = [val for val in self.widget.__bases__ if issubclass(val, QObject)]
83
+ if not base_cls:
84
+ raise ValueError(
85
+ f"Widget class {self.widget.__name__} must inherit from a QObject subclass."
86
+ )
87
+
88
+ # Check if the widget class calls the super constructor with parent argument
89
+ init_source = inspect.getsource(self.widget.__init__)
90
+ cls_init_found = (
91
+ bool(init_source.find(f"{base_cls[0].__name__}.__init__(self, parent=parent") > 0)
92
+ or bool(init_source.find(f"{base_cls[0].__name__}.__init__(self, parent)") > 0)
93
+ or bool(init_source.find(f"{base_cls[0].__name__}.__init__(self, parent,") > 0)
94
+ )
95
+ super_init_found = (
96
+ bool(
97
+ init_source.find(f"super({base_cls[0].__name__}, self).__init__(parent=parent") > 0
98
+ )
99
+ or bool(init_source.find(f"super({base_cls[0].__name__}, self).__init__(parent,") > 0)
100
+ or bool(init_source.find(f"super({base_cls[0].__name__}, self).__init__(parent)") > 0)
101
+ )
102
+ if issubclass(self.widget.__bases__[0], QObject) and not super_init_found:
103
+ super_init_found = (
104
+ bool(init_source.find("super().__init__(parent=parent") > 0)
105
+ or bool(init_source.find("super().__init__(parent,") > 0)
106
+ or bool(init_source.find("super().__init__(parent)") > 0)
107
+ )
108
+
109
+ if not cls_init_found and not super_init_found:
110
+ raise ValueError(
111
+ f"Widget class {self.widget.__name__} must call the super constructor with parent."
112
+ )
113
+
114
+ def _write_templates(self):
115
+ self._write_register()
116
+ self._write_plugin()
117
+ self._write_pyproject()
118
+
119
+ def _write_register(self):
120
+ file_path = os.path.join(self.info.base_path, f"register_{self.info.plugin_name_snake}.py")
121
+ with open(file_path, "w", encoding="utf-8") as f:
122
+ f.write(self.templates["register"].format(**self.info.__dict__))
123
+
124
+ def _write_plugin(self):
125
+ file_path = os.path.join(self.info.base_path, f"{self.info.plugin_name_snake}_plugin.py")
126
+ with open(file_path, "w", encoding="utf-8") as f:
127
+ f.write(self.templates["plugin"].format(**self.info.__dict__))
128
+
129
+ def _write_pyproject(self):
130
+ file_path = os.path.join(self.info.base_path, f"{self.info.plugin_name_snake}.pyproject")
131
+ out = {"files": [f"{self.info.plugin_class.__module__.split('.')[-1]}.py"]}
132
+ with open(file_path, "w", encoding="utf-8") as f:
133
+ f.write(str(out))
134
+
135
+ def _load_templates(self):
136
+ for file in os.listdir(self.template_path):
137
+ if not file.endswith(".template"):
138
+ continue
139
+ with open(os.path.join(self.template_path, file), "r", encoding="utf-8") as f:
140
+ self.templates[file.split(".")[0]] = f.read()
141
+
142
+
143
+ if __name__ == "__main__": # pragma: no cover
144
+ # from bec_widgets.widgets.bec_queue.bec_queue import BECQueue
145
+ from bec_widgets.widgets.dock import BECDockArea
146
+
147
+ generator = DesignerPluginGenerator(BECDockArea)
148
+ generator.run()
@@ -0,0 +1,54 @@
1
+ # Copyright (C) 2022 The Qt Company Ltd.
2
+ # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
+
4
+ from qtpy.QtDesigner import QDesignerCustomWidgetInterface
5
+ from qtpy.QtGui import QIcon
6
+
7
+ {widget_import}
8
+
9
+ DOM_XML = """
10
+ <ui language='c++'>
11
+ <widget class='{plugin_name_pascal}' name='{plugin_name_snake}'>
12
+ </widget>
13
+ </ui>
14
+ """
15
+
16
+
17
+ class {plugin_name_pascal}Plugin(QDesignerCustomWidgetInterface): # pragma: no cover
18
+ def __init__(self):
19
+ super().__init__()
20
+ self._form_editor = None
21
+
22
+ def createWidget(self, parent):
23
+ t = {plugin_name_pascal}(parent)
24
+ return t
25
+
26
+ def domXml(self):
27
+ return DOM_XML
28
+
29
+ def group(self):
30
+ return ""
31
+
32
+ def icon(self):
33
+ return QIcon()
34
+
35
+ def includeFile(self):
36
+ return "{plugin_name_snake}"
37
+
38
+ def initialize(self, form_editor):
39
+ self._form_editor = form_editor
40
+
41
+ def isContainer(self):
42
+ return False
43
+
44
+ def isInitialized(self):
45
+ return self._form_editor is not None
46
+
47
+ def name(self):
48
+ return "{plugin_name_pascal}"
49
+
50
+ def toolTip(self):
51
+ return "{plugin_tooltip}"
52
+
53
+ def whatsThis(self):
54
+ return self.toolTip()
@@ -0,0 +1,15 @@
1
+ def main(): # pragma: no cover
2
+ from qtpy import PYSIDE6
3
+
4
+ if not PYSIDE6:
5
+ print("PYSIDE6 is not available in the environment. Cannot patch designer.")
6
+ return
7
+ from PySide6.QtDesigner import QPyDesignerCustomWidgetCollection
8
+
9
+ {plugin_import}
10
+
11
+ QPyDesignerCustomWidgetCollection.addCustomWidget({plugin_name_pascal}Plugin())
12
+
13
+
14
+ if __name__ == "__main__": # pragma: no cover
15
+ main()
@@ -104,7 +104,7 @@ class RingProgressBar(BECConnector, QWidget):
104
104
  config = RingProgressBarConfig(**config, widget_class=self.__class__.__name__)
105
105
  self.config = config
106
106
  super().__init__(client=client, config=config, gui_id=gui_id)
107
- QWidget.__init__(self, parent=None)
107
+ QWidget.__init__(self, parent=parent)
108
108
 
109
109
  self.get_bec_shortcuts()
110
110
  self.entry_validator = EntryValidator(self.dev)
@@ -31,7 +31,7 @@ class TextBox(BECConnector, QTextEdit):
31
31
 
32
32
  USER_ACCESS = ["set_color", "set_text", "set_font_size"]
33
33
 
34
- def __init__(self, text: str = "", parent=None, client=None, config=None, gui_id=None):
34
+ def __init__(self, parent=None, text: str = "", client=None, config=None, gui_id=None):
35
35
  if config is None:
36
36
  config = TextBoxConfig(widget_class=self.__class__.__name__)
37
37
  else:
@@ -21,7 +21,7 @@ class WebsiteWidget(BECConnector, QWebEngineView):
21
21
 
22
22
  USER_ACCESS = ["set_url", "get_url", "reload", "back", "forward"]
23
23
 
24
- def __init__(self, url: str = None, parent=None, config=None, client=None, gui_id=None):
24
+ def __init__(self, parent=None, url: str = None, config=None, client=None, gui_id=None):
25
25
  super().__init__(client=client, config=config, gui_id=gui_id)
26
26
  QWebEngineView.__init__(self, parent=parent)
27
27
  self.set_url(url)
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "bec_widgets"
7
- version = "0.75.0"
7
+ version = "0.76.1"
8
8
  description = "BEC Widgets"
9
9
  requires-python = ">=3.10"
10
10
  classifiers = [
@@ -0,0 +1,155 @@
1
+ import importlib
2
+ import inspect
3
+ import os
4
+ import sys
5
+
6
+ import pytest
7
+
8
+ from bec_widgets.utils.generate_designer_plugin import DesignerPluginGenerator
9
+
10
+
11
+ def load_plugin(dir_path, content, plugin_name="MyWidget"):
12
+ plugin_path = dir_path.mkdir("plugin").join("plugin.py")
13
+ plugin_path.write(content)
14
+ sys.path.append(str(dir_path))
15
+ plugin = importlib.import_module("plugin.plugin")
16
+ importlib.reload(plugin)
17
+ yield getattr(plugin, plugin_name)
18
+ sys.path.pop()
19
+
20
+
21
+ @pytest.fixture(
22
+ params=[
23
+ """
24
+ from qtpy.QtWidgets import QWidget
25
+ class MyWidget(QWidget):
26
+ def __init__(self, parent=None):
27
+ QWidget.__init__(self, parent)
28
+ """,
29
+ """
30
+ from qtpy.QtWidgets import QWidget
31
+ class MyWidget(QWidget):
32
+ def __init__(self, parent=None):
33
+ QWidget.__init__(self, parent=parent)
34
+ """,
35
+ """
36
+ from qtpy.QtWidgets import QWidget
37
+ class MyWidget(QWidget):
38
+ def __init__(self, parent=None):
39
+ super().__init__(parent)
40
+ """,
41
+ """
42
+ from qtpy.QtWidgets import QWidget
43
+ class MyWidget(QWidget):
44
+ def __init__(self, parent=None):
45
+ super().__init__(parent=parent)
46
+ """,
47
+ """
48
+ from qtpy.QtWidgets import QWidget
49
+ class MyWidget(QWidget):
50
+ def __init__(self, parent=None):
51
+ super(QWidget, self).__init__(parent)"""
52
+ """
53
+ from qtpy.QtWidgets import QWidget
54
+ class MyWidget(QWidget):
55
+ def __init__(self, parent=None):
56
+ super(QWidget, self).__init__(parent=parent)
57
+ """,
58
+ ]
59
+ )
60
+ def plugin_with_correct_parent(tmpdir, request):
61
+ yield from load_plugin(tmpdir, request.param)
62
+
63
+
64
+ @pytest.fixture(
65
+ params=[
66
+ """
67
+ from qtpy.QtWidgets import QWidget
68
+ class MyWidget(QWidget):
69
+ def __init__(self, parent=None):
70
+ QWidget.__init__(self)
71
+ """,
72
+ """
73
+ from qtpy.QtWidgets import QWidget
74
+ class MyWidget(QWidget):
75
+ def __init__(self, parent=None):
76
+ super().__init__()
77
+ """,
78
+ """
79
+ from qtpy.QtWidgets import QWidget
80
+ class MyWidget(QWidget):
81
+ def __init__(self, parent=None):
82
+ super(QWidget, self).__init__()
83
+ """,
84
+ ]
85
+ )
86
+ def plugin_with_missing_parent(tmpdir, request):
87
+ yield from load_plugin(tmpdir, request.param)
88
+
89
+
90
+ def test_generate_plugin(plugin_with_correct_parent):
91
+ generator = DesignerPluginGenerator(plugin_with_correct_parent)
92
+ generator.run()
93
+ assert os.path.exists(f"{generator.info.base_path}/register_my_widget.py")
94
+ assert os.path.exists(f"{generator.info.base_path}/my_widget_plugin.py")
95
+ assert os.path.exists(f"{generator.info.base_path}/my_widget.pyproject")
96
+
97
+
98
+ def test_generate_plugin_with_missing_parent(plugin_with_missing_parent):
99
+ with pytest.raises(ValueError) as excinfo:
100
+ generator = DesignerPluginGenerator(plugin_with_missing_parent)
101
+ generator.run()
102
+ assert "Widget class MyWidget must call the super constructor with parent." in str(
103
+ excinfo.value
104
+ )
105
+
106
+
107
+ @pytest.fixture()
108
+ def plugin_with_excluded_widget(tmpdir):
109
+ content = """
110
+ from qtpy.QtWidgets import QWidget
111
+ class BECDock(QWidget):
112
+ def __init__(self, parent=None):
113
+ QWidget.__init__(self, parent)
114
+ """
115
+ yield from load_plugin(tmpdir, content, plugin_name="BECDock")
116
+
117
+
118
+ def test_generate_plugin_with_excluded_widget(plugin_with_excluded_widget, capsys):
119
+ generator = DesignerPluginGenerator(plugin_with_excluded_widget)
120
+ generator.run()
121
+ captured = capsys.readouterr()
122
+
123
+ assert "Plugin BECDock is excluded from generation." in captured.out
124
+ assert not os.path.exists(f"{generator.info.base_path}/register_bec_dock.py")
125
+ assert not os.path.exists(f"{generator.info.base_path}/bec_dock_plugin.py")
126
+ assert not os.path.exists(f"{generator.info.base_path}/bec_dock.pyproject")
127
+
128
+
129
+ @pytest.fixture(
130
+ params=[
131
+ """
132
+ from qtpy.QtWidgets import QWidget
133
+ class MyWidget(QWidget):
134
+ def __init__(self):
135
+ QWidget.__init__(self)
136
+ """,
137
+ """
138
+ from qtpy.QtWidgets import QWidget
139
+ class MyWidget(QWidget):
140
+ def __init__(self, config, parent=None):
141
+ super().__init__()
142
+ """,
143
+ ]
144
+ )
145
+ def plugin_with_no_parent_as_first_arg(tmpdir, request):
146
+ yield from load_plugin(tmpdir, request.param)
147
+
148
+
149
+ def test_generate_plugin_raises_exception_when_first_argument_is_not_parent(
150
+ plugin_with_no_parent_as_first_arg,
151
+ ):
152
+ with pytest.raises(ValueError) as excinfo:
153
+ generator = DesignerPluginGenerator(plugin_with_no_parent_as_first_arg)
154
+ generator.run()
155
+ assert "Widget class MyWidget must have parent as the first argument." in str(excinfo.value)
File without changes
File without changes
File without changes
File without changes