scipion-pyworkflow 3.4.0__tar.gz → 3.6.0__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 (253) hide show
  1. {scipion-pyworkflow-3.4.0/scipion_pyworkflow.egg-info → scipion_pyworkflow-3.6.0}/PKG-INFO +1 -1
  2. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/apps/pw_project.py +3 -8
  3. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/config.py +197 -116
  4. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/constants.py +4 -2
  5. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/gui/browser.py +15 -17
  6. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/gui/canvas.py +3 -3
  7. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/gui/dialog.py +59 -61
  8. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/gui/form.py +1 -1
  9. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/gui/graph_layout.py +29 -37
  10. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/gui/gui.py +56 -33
  11. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/gui/project/base.py +5 -2
  12. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/gui/project/labels.py +4 -2
  13. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/gui/project/project.py +7 -26
  14. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/gui/project/searchrun.py +19 -12
  15. scipion_pyworkflow-3.6.0/pyworkflow/gui/project/variables.py +179 -0
  16. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/gui/project/viewdata.py +1 -34
  17. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/gui/project/viewprojects.py +3 -5
  18. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/gui/project/viewprotocols.py +34 -104
  19. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/gui/project/viewprotocols_extra.py +2 -3
  20. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/gui/tree.py +2 -2
  21. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/gui/widgets.py +1 -1
  22. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/mapper/mapper.py +1 -2
  23. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/mapper/sqlite.py +48 -13
  24. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/object.py +40 -14
  25. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/plugin.py +23 -14
  26. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/project/__init__.py +1 -1
  27. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/project/config.py +0 -15
  28. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/project/project.py +18 -6
  29. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/protocol/executor.py +12 -0
  30. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/protocol/launch.py +32 -25
  31. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/protocol/protocol.py +39 -6
  32. scipion_pyworkflow-3.6.0/pyworkflow/resources/sprites.png +0 -0
  33. scipion_pyworkflow-3.6.0/pyworkflow/resources/sprites.xcf +0 -0
  34. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/template.py +9 -17
  35. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/utils/log.py +2 -2
  36. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/utils/path.py +54 -2
  37. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/utils/progressbar.py +14 -3
  38. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/utils/properties.py +165 -99
  39. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/utils/utils.py +25 -1
  40. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/viewer.py +7 -1
  41. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflowtests/tests/test_mappers.py +22 -0
  42. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflowtests/tests/test_object.py +12 -1
  43. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflowtests/tests/test_utils.py +74 -4
  44. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0/scipion_pyworkflow.egg-info}/PKG-INFO +1 -1
  45. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/scipion_pyworkflow.egg-info/SOURCES.txt +3 -86
  46. scipion-pyworkflow-3.4.0/pyworkflow/resources/backward-solid.png +0 -0
  47. scipion-pyworkflow-3.4.0/pyworkflow/resources/beta.png +0 -0
  48. scipion-pyworkflow-3.4.0/pyworkflow/resources/binoculares.png +0 -0
  49. scipion-pyworkflow-3.4.0/pyworkflow/resources/bookmark.png +0 -0
  50. scipion-pyworkflow-3.4.0/pyworkflow/resources/broom-solid.png +0 -0
  51. scipion-pyworkflow-3.4.0/pyworkflow/resources/class_obj.png +0 -0
  52. scipion-pyworkflow-3.4.0/pyworkflow/resources/clipboard-regular.png +0 -0
  53. scipion-pyworkflow-3.4.0/pyworkflow/resources/code-branch-solid.png +0 -0
  54. scipion-pyworkflow-3.4.0/pyworkflow/resources/debug.png +0 -0
  55. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-arrow-down.png +0 -0
  56. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-arrow-left.png +0 -0
  57. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-arrow-up.png +0 -0
  58. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-ban.png +0 -0
  59. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-bars.png +0 -0
  60. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-check.png +0 -0
  61. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-checked.png +0 -0
  62. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-cog.png +0 -0
  63. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-cogs.png +0 -0
  64. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-database.png +0 -0
  65. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-delete-operation.png +0 -0
  66. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-download.png +0 -0
  67. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-external-link.png +0 -0
  68. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-eye.png +0 -0
  69. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-failure.png +0 -0
  70. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-file-o.png +0 -0
  71. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-files-o.png +0 -0
  72. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-folder-open.png +0 -0
  73. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-home.png +0 -0
  74. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-install.png +0 -0
  75. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-installed.png +0 -0
  76. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-lightbulb-o.png +0 -0
  77. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-list-ul.png +0 -0
  78. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-magic.png +0 -0
  79. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-minus-square.png +0 -0
  80. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-next.png +0 -0
  81. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-pencil.png +0 -0
  82. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-play-circle-o.png +0 -0
  83. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-plus-square.png +0 -0
  84. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-previous.png +0 -0
  85. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-processing.png +0 -0
  86. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-question-circle.png +0 -0
  87. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-refresh.png +0 -0
  88. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-rocket.png +0 -0
  89. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-save.png +0 -0
  90. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-sign-in.png +0 -0
  91. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-sign-out.png +0 -0
  92. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-sitemap.png +0 -0
  93. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-stop-workflow.png +0 -0
  94. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-stop.png +0 -0
  95. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-tags.png +0 -0
  96. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-times.png +0 -0
  97. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-to_install.png +0 -0
  98. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-trash-o.png +0 -0
  99. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-unchecked.png +0 -0
  100. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-undo.png +0 -0
  101. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-uninstall.png +0 -0
  102. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-update.png +0 -0
  103. scipion-pyworkflow-3.4.0/pyworkflow/resources/fa-upload.png +0 -0
  104. scipion-pyworkflow-3.4.0/pyworkflow/resources/file.png +0 -0
  105. scipion-pyworkflow-3.4.0/pyworkflow/resources/file_folder.png +0 -0
  106. scipion-pyworkflow-3.4.0/pyworkflow/resources/file_folder_link.png +0 -0
  107. scipion-pyworkflow-3.4.0/pyworkflow/resources/file_generic.png +0 -0
  108. scipion-pyworkflow-3.4.0/pyworkflow/resources/file_generic_link.png +0 -0
  109. scipion-pyworkflow-3.4.0/pyworkflow/resources/file_image.png +0 -0
  110. scipion-pyworkflow-3.4.0/pyworkflow/resources/file_image_link.png +0 -0
  111. scipion-pyworkflow-3.4.0/pyworkflow/resources/file_java.png +0 -0
  112. scipion-pyworkflow-3.4.0/pyworkflow/resources/file_log.png +0 -0
  113. scipion-pyworkflow-3.4.0/pyworkflow/resources/file_md.png +0 -0
  114. scipion-pyworkflow-3.4.0/pyworkflow/resources/file_md_link.png +0 -0
  115. scipion-pyworkflow-3.4.0/pyworkflow/resources/file_python.png +0 -0
  116. scipion-pyworkflow-3.4.0/pyworkflow/resources/file_sqlite.png +0 -0
  117. scipion-pyworkflow-3.4.0/pyworkflow/resources/file_stack.png +0 -0
  118. scipion-pyworkflow-3.4.0/pyworkflow/resources/file_stack_link.png +0 -0
  119. scipion-pyworkflow-3.4.0/pyworkflow/resources/file_text.png +0 -0
  120. scipion-pyworkflow-3.4.0/pyworkflow/resources/new.png +0 -0
  121. scipion-pyworkflow-3.4.0/pyworkflow/resources/no-image.png +0 -0
  122. scipion-pyworkflow-3.4.0/pyworkflow/resources/paste-solid.png +0 -0
  123. scipion-pyworkflow-3.4.0/pyworkflow/resources/power-off-solid.png +0 -0
  124. scipion-pyworkflow-3.4.0/pyworkflow/resources/production.png +0 -0
  125. scipion-pyworkflow-3.4.0/pyworkflow/resources/prot_disabled.png +0 -0
  126. scipion-pyworkflow-3.4.0/pyworkflow/resources/question.png +0 -0
  127. scipion-pyworkflow-3.4.0/pyworkflow/resources/rename.png +0 -0
  128. scipion-pyworkflow-3.4.0/pyworkflow/resources/root.png +0 -0
  129. scipion-pyworkflow-3.4.0/pyworkflow/resources/updated.png +0 -0
  130. scipion-pyworkflow-3.4.0/pyworkflow/resources/users.png +0 -0
  131. scipion-pyworkflow-3.4.0/pyworkflow/resources/workflow.png +0 -0
  132. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/LICENSE.txt +0 -0
  133. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/MANIFEST.in +0 -0
  134. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/README.rst +0 -0
  135. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/__init__.py +0 -0
  136. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/apps/__init__.py +0 -0
  137. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/apps/pw_manager.py +0 -0
  138. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/apps/pw_plot.py +0 -0
  139. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/apps/pw_protocol_list.py +0 -0
  140. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/apps/pw_protocol_run.py +0 -0
  141. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/apps/pw_run_tests.py +0 -0
  142. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/apps/pw_schedule_run.py +0 -0
  143. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/apps/pw_sleep.py +0 -0
  144. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/apps/pw_sync_data.py +0 -0
  145. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/apps/pw_viewer.py +0 -0
  146. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/exceptions.py +0 -0
  147. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/gui/__init__.py +0 -0
  148. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/gui/graph.py +0 -0
  149. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/gui/matplotlib_image.py +0 -0
  150. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/gui/plotter.py +0 -0
  151. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/gui/project/__init__.py +0 -0
  152. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/gui/project/constants.py +0 -0
  153. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/gui/project/searchprotocol.py +0 -0
  154. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/gui/project/steps.py +0 -0
  155. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/gui/project/utils.py +0 -0
  156. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/gui/text.py +0 -0
  157. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/gui/tooltip.py +0 -0
  158. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/mapper/__init__.py +0 -0
  159. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/mapper/sqlite_db.py +0 -0
  160. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/mapper/xmlmapper.py +0 -0
  161. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/project/manager.py +0 -0
  162. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/project/scripts/clean_projects.py +0 -0
  163. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/project/scripts/config.py +0 -0
  164. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/project/scripts/create.py +0 -0
  165. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/project/scripts/edit_workflow.py +0 -0
  166. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/project/scripts/fix_links.py +0 -0
  167. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/project/scripts/load.py +0 -0
  168. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/project/scripts/refresh.py +0 -0
  169. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/project/scripts/schedule.py +0 -0
  170. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/project/scripts/stack2volume.py +0 -0
  171. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/project/scripts/stop.py +0 -0
  172. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/protocol/__init__.py +0 -0
  173. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/protocol/bibtex.py +0 -0
  174. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/protocol/constants.py +0 -0
  175. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/protocol/hosts.py +0 -0
  176. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/protocol/package.py +0 -0
  177. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/protocol/params.py +0 -0
  178. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/Imagej.png +0 -0
  179. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/chimera.png +0 -0
  180. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/fa-exclamation-triangle_alert.png +0 -0
  181. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/fa-info-circle_alert.png +0 -0
  182. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/fa-search.png +0 -0
  183. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/fa-times-circle_alert.png +0 -0
  184. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/file_vol.png +0 -0
  185. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/loading.gif +0 -0
  186. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/no-image128.png +0 -0
  187. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/scipion_bn.png +0 -0
  188. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/scipion_icon.png +0 -0
  189. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/scipion_icon.svg +0 -0
  190. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/scipion_icon_proj.png +0 -0
  191. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/scipion_icon_projs.png +0 -0
  192. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/scipion_icon_prot.png +0 -0
  193. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/scipion_logo.png +0 -0
  194. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/scipion_logo_normal.png +0 -0
  195. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/scipion_logo_small.png +0 -0
  196. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/showj/arrowDown.png +0 -0
  197. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/showj/arrowUp.png +0 -0
  198. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/showj/background_section.png +0 -0
  199. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/showj/colRowModeOff.png +0 -0
  200. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/showj/colRowModeOn.png +0 -0
  201. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/showj/delete.png +0 -0
  202. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/showj/doc_icon.png +0 -0
  203. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/showj/download_icon.png +0 -0
  204. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/showj/enabled_gallery.png +0 -0
  205. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/showj/galleryViewOff.png +0 -0
  206. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/showj/galleryViewOn.png +0 -0
  207. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/showj/goto.png +0 -0
  208. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/showj/menu.png +0 -0
  209. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/showj/separator.png +0 -0
  210. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/showj/tableViewOff.png +0 -0
  211. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/showj/tableViewOn.png +0 -0
  212. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/showj/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  213. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/showj/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  214. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/showj/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  215. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/showj/volumeOff.png +0 -0
  216. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/showj/volumeOn.png +0 -0
  217. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/resources/wait.gif +0 -0
  218. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/tests/__init__.py +0 -0
  219. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/tests/test_utils.py +0 -0
  220. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/tests/tests.py +0 -0
  221. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/utils/__init__.py +0 -0
  222. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/utils/dataset.py +0 -0
  223. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/utils/echo.py +0 -0
  224. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/utils/graph.py +0 -0
  225. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/utils/process.py +0 -0
  226. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/utils/profiler.py +0 -0
  227. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/utils/reflection.py +0 -0
  228. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/utils/which.py +0 -0
  229. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/webservices/__init__.py +0 -0
  230. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/webservices/config.py +0 -0
  231. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/webservices/notifier.py +0 -0
  232. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/webservices/repository.py +0 -0
  233. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflow/wizard.py +0 -0
  234. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflowtests/__init__.py +0 -0
  235. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflowtests/bibtex.py +0 -0
  236. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflowtests/objects.py +0 -0
  237. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflowtests/protocols.py +0 -0
  238. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflowtests/tests/__init__.py +0 -0
  239. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflowtests/tests/test_canvas.py +0 -0
  240. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflowtests/tests/test_domain.py +0 -0
  241. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflowtests/tests/test_logs.py +0 -0
  242. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflowtests/tests/test_project.py +0 -0
  243. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflowtests/tests/test_protocol_execution.py +0 -0
  244. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflowtests/tests/test_protocol_export.py +0 -0
  245. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflowtests/tests/test_protocol_output.py +0 -0
  246. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/pyworkflowtests/tests/test_streaming.py +0 -0
  247. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/requirements.txt +0 -0
  248. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/scipion_pyworkflow.egg-info/dependency_links.txt +0 -0
  249. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/scipion_pyworkflow.egg-info/entry_points.txt +0 -0
  250. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/scipion_pyworkflow.egg-info/requires.txt +0 -0
  251. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/scipion_pyworkflow.egg-info/top_level.txt +0 -0
  252. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/setup.cfg +0 -0
  253. {scipion-pyworkflow-3.4.0 → scipion_pyworkflow-3.6.0}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: scipion-pyworkflow
3
- Version: 3.4.0
3
+ Version: 3.6.0
4
4
  Summary: Simple workflow platform used in scientific applications, initially developed within the Scipion framework for image processing in Electron Microscopy.
5
5
  Home-page: https://github.com/scipion-em/scipion-pyworkflow
6
6
  Author: J.M. De la Rosa Trevin, Roberto Marabini, Grigory Sharov, Josue Gomez Blanco, Pablo Conesa, Yunior Fonseca Reyna
@@ -36,19 +36,14 @@ from pyworkflow.project import Manager
36
36
  from pyworkflow.gui.project import ProjectWindow
37
37
  import pyworkflow.utils as pwutils
38
38
 
39
- import logging
40
-
41
39
  HERE = 'here'
42
-
43
40
  LAST = 'last'
44
-
45
41
  LIST = 'list'
46
- logger = logging.getLogger(__name__)
47
42
 
48
43
  def openProject(projectName):
49
44
  """ Opens a scipion project:
50
45
 
51
- :param projectName: Name of a existing project to open,
46
+ :param projectName: Name of an existing project to open,
52
47
  or "here" to create a project in the current working dir,
53
48
  or "last" to open the most recent project
54
49
 
@@ -97,7 +92,7 @@ def openProject(projectName):
97
92
  projWindow = ProjectWindow(projPath)
98
93
  projWindow.show()
99
94
  else:
100
- logger.error("Can't open project %s. It does not exist" % projPath)
95
+ print("Can't open project %s. It does not exist" % projPath)
101
96
 
102
97
  #Show the list of projects
103
98
  showProjectList(manager)
@@ -115,4 +110,4 @@ if __name__ == '__main__':
115
110
  if len(sys.argv) > 1:
116
111
  openProject(sys.argv[1])
117
112
  else:
118
- logger.info("usage: pw_project.py PROJECT_NAME or %s or %s or %s" % (HERE, LAST, LIST))
113
+ print("usage: pw_project.py PROJECT_NAME or %s or %s or %s" % (HERE, LAST, LIST))
@@ -1,10 +1,9 @@
1
-
2
1
  import logging
2
+
3
3
  logger = logging.getLogger(__file__)
4
4
  import ast
5
5
  import importlib
6
6
  import inspect
7
- import json
8
7
  import os
9
8
  import shutil
10
9
  import sys
@@ -20,12 +19,15 @@ def join(*paths):
20
19
  return os.path.join(HOME, *paths)
21
20
 
22
21
 
23
- __resourcesPath = [join('resources')]
22
+ __resourcesPath = join('resources')
24
23
 
24
+ def getResourcesPath(file=None):
25
+
26
+ return __resourcesPath if file is None else os.path.join(__resourcesPath, file)
25
27
 
26
28
  def findResource(filename):
27
29
  from .utils.path import findFile
28
- return findFile(filename, *__resourcesPath)
30
+ return findFile(filename, *[__resourcesPath])
29
31
 
30
32
 
31
33
  def genNotesHeading():
@@ -63,23 +65,106 @@ def getModuleFolder(moduleName):
63
65
  return os.path.dirname(spec.origin)
64
66
 
65
67
 
68
+ def validColor(colorname):
69
+ """ If it can be converted to rgb is a valid color"""
70
+ from matplotlib.colors import to_rgb
71
+ to_rgb(colorname)
72
+ return colorname
73
+
74
+ class VarTypes(Enum):
75
+ STRING = 0
76
+ BOOLEAN = 1
77
+ PATH = 2 # Any Path: Folder or file
78
+ INTEGER = 3
79
+ DECIMAL = 4
80
+ FILENAME = 5 # Just the base name of a file
81
+ FOLDER = 6 # A folder
82
+
83
+ class Variable:
84
+ def __init__(self, name, description, source, value, default, var_type: VarTypes = VarTypes.STRING, isDefault=None):
85
+ self.name = name
86
+ self.description = description
87
+ self.source = source
88
+ self.value = value
89
+ self.default = default
90
+ self.var_type = var_type
91
+ self.isDefault = isDefault if isDefault is not None else value==default
92
+ def setToDefault(self):
93
+ self.isDefault=True
94
+ self.value=self.default
95
+
96
+ class VariablesRegistry:
97
+ _variables={}
98
+
99
+ def __init__(self):
100
+ raise RuntimeError("Variables class doesn't need to be instantiated.")
101
+ @classmethod
102
+ def register(cls, variable: Variable):
103
+ cls._variables[variable.name] = variable
104
+
105
+ @classmethod
106
+ def variables(cls):
107
+ return cls._variables
108
+
109
+ @classmethod
110
+ def __iter__(cls):
111
+ """ Iterate alphabetically"""
112
+ for key in sorted(cls._variables):
113
+ yield cls._variables[key]
114
+
115
+ @classmethod
116
+ def save(cls, path):
117
+ """ Saves the variables in the path specified """
118
+ from pyworkflow.utils import backup
119
+ backup(path)
120
+
121
+ with open(path,"w") as fh:
122
+ # Save the section as in any python config file format.
123
+ fh.write("[PYWORKFLOW]\n")
124
+ for var in cls.__iter__():
125
+ if var.source == "pyworkflow" and not var.isDefault:
126
+ fh.write("%s=%s\n" % (var.name, var.value))
127
+
128
+ fh.write("\n[PLUGINS]\n")
129
+ for var in cls._variables.values():
130
+ if var.source != "pyworkflow" and not var.isDefault:
131
+ fh.write("%s=%s\n" % (var.name, var.value))
132
+
133
+
66
134
  class Config:
67
135
  """ Main Config for pyworkflow. It contains the main Scipion configuration variables
68
136
  providing default values or, if present, taking them from the environment.
69
137
  Necessary value is SCIPION_HOME and has to be present in the environment"""
70
138
 
71
139
  @staticmethod
72
- def __get(key, default):
73
- value = os.environ.get(key, default)
140
+ def __get(key, default, description=None, caster=None, var_type:VarTypes=VarTypes.STRING, source="pyworkflow"):
74
141
 
142
+ if key in os.environ:
143
+ value = os.environ.get(key)
144
+ isDefault = (value==default)
145
+ else:
146
+ isDefault = True
147
+ value = default
148
+
149
+ # If the caster is passed do the casting, if fails go back to default
150
+ if caster:
151
+ try:
152
+ value=caster(value)
153
+ except:
154
+ logger.warning("Variable %s has this value %s that can't be casted to the right type (%s). Using %s (default value)" %
155
+ (key,value, caster, default))
156
+ value = default
75
157
  # If empty use default value
76
158
  if value == "" != default:
77
159
  logger.warning("%s variable is empty, falling back to default value (%s)" % (key, default))
78
160
  value = default
161
+
79
162
  # Expand user and variables if string value
80
163
  if isinstance(value, str):
81
164
  value = os.path.expandvars(os.path.expanduser(value))
82
165
 
166
+ # Register the variable
167
+ VariablesRegistry.register(Variable(key,description, source, value, default, var_type=var_type, isDefault=isDefault))
83
168
  return value
84
169
 
85
170
  class Root:
@@ -97,139 +182,145 @@ class Config:
97
182
 
98
183
  # Home for scipion
99
184
  _get = __get.__func__
100
- SCIPION_HOME = os.path.abspath(_get(SCIPION_HOME_VAR, ''))
101
- "Path where Scipion is installed. Other paths are based on this like SCIPION_SOFTWARE, SCIPION_TESTS,... unless specified"
185
+ SCIPION_HOME = os.path.abspath(_get(SCIPION_HOME_VAR, '',
186
+ "Path where Scipion is installed. Other paths are based on this like SCIPION_SOFTWARE, SCIPION_TESTS,... unless specified"))
102
187
 
103
- # Actual SCIPION_HOME
104
- SCIPION_HOME_DEFINED = _get(SCIPION_HOME_VAR, False)
105
- "False if SCIPION_HOME is not found in the environment"
188
+ # False if SCIPION_HOME is not found in the environment. To distinguish API documentation generation execution.
189
+ SCIPION_HOME_DEFINED = SCIPION_HOME != ''
106
190
 
107
- _root = Root(SCIPION_HOME)
191
+ _root = Root(str(SCIPION_HOME))
108
192
  _join = _root.join
109
193
 
110
194
  # Internal cached variables, use __ so they are not returned in getVars
111
195
  __activeColor = None
112
196
 
113
- CONDA_ACTIVATION_CMD = _get(CONDA_ACTIVATION_CMD_VAR,'')
114
- "str: Command to activate/initialize conda itself. Do not confuse it with 'conda activate'. It should be defined at installation time. It looks like this: eval \"$(/extra/miniconda3/bin/conda shell.bash hook)\""
197
+ CONDA_ACTIVATION_CMD = _get(CONDA_ACTIVATION_CMD_VAR,'',
198
+ "str: Command to activate/initialize conda itself. Do not confuse it with 'conda activate'. It should be defined at installation time. It looks like this: eval \"$(/extra/miniconda3/bin/conda shell.bash hook)\"")
115
199
 
116
200
  # SCIPION PATHS
117
- SCIPION_SOFTWARE = _join(_get('SCIPION_SOFTWARE', 'software'))
118
- "Path where Scipion will install the software. Defaults to SCIPION_HOME/software."
201
+ SCIPION_SOFTWARE = _get('SCIPION_SOFTWARE', _join('software'),
202
+ "Path where Scipion will install the software. Defaults to SCIPION_HOME/software.", var_type=VarTypes.FOLDER)
119
203
 
120
- SCIPION_TESTS = _join(_get('SCIPION_TESTS', os.path.join('data', 'tests')))
121
- "Path where to find/download test data. Defaults to SCIPION_HOME/data/tests."
204
+ SCIPION_TESTS = _get('SCIPION_TESTS', _join('data', 'tests'),
205
+ "Path where to find/download test data. Defaults to SCIPION_HOME/data/tests.", var_type=VarTypes.FOLDER)
122
206
 
123
207
  # User dependent paths
124
- SCIPION_USER_DATA = _get('SCIPION_USER_DATA', '~/ScipionUserData')
125
- "Path where Scipion projects are or will be created. Defaults to ~/ScipionUserData"
126
-
127
- SCIPION_TMP = _get('SCIPION_TMP', _join(SCIPION_USER_DATA, 'tmp'))
128
- "General purpose scipion tmp folder. Defaults to SCIPION_USER_DATA/tmp"
208
+ SCIPION_USER_DATA = _get('SCIPION_USER_DATA', '~/ScipionUserData',
209
+ "Path where Scipion projects are or will be created. Defaults to ~/ScipionUserData", var_type=VarTypes.FOLDER)
129
210
 
130
211
  # LOGGING variables
131
- SCIPION_LOGS = _get('SCIPION_LOGS', _join(SCIPION_USER_DATA, 'logs'))
132
- "Path for Scipion logs folder used by the GUI. Defaults to SCIPION_USER_DATA/logs."
133
-
134
- SCIPION_LOG_CONFIG = _get('SCIPION_LOG_CONFIG', None)
135
- "Optional. Path to a python logging configuration file fine tune the logging."
212
+ SCIPION_LOGS = _get('SCIPION_LOGS', _join(SCIPION_USER_DATA, 'logs'),
213
+ "Folder for Scipion logs used by the GUI. Defaults to SCIPION_USER_DATA/logs.", var_type=VarTypes.FOLDER)
136
214
 
137
- SCIPION_LOG = _join(SCIPION_LOGS, 'scipion.log')
138
- "Path to the file where scipion will write GUI logging messages. Defaults to SCIPION_LOGS/scipion.log"
215
+ SCIPION_LOG_CONFIG = _get('SCIPION_LOG_CONFIG', None,
216
+ "Optional. Path to a python logging configuration file to fine tune the logging.", var_type=VarTypes.PATH)
139
217
 
140
- SCIPION_LOG_FORMAT = _get('SCIPION_LOG_FORMAT', "%(message)s")
141
- "str: Format for all the log lines, defaults to %(message)s. To compose the format see https://docs.python.org/3/library/logging.html#logrecord-attributes"
218
+ SCIPION_LOG = _get('SCIPION_LOG', _join(SCIPION_LOGS, 'scipion.log'),
219
+ "Path to the file where scipion will write GUI logging messages. Defaults to SCIPION_LOGS/scipion.log", var_type=VarTypes.PATH)
142
220
 
143
- SCIPION_LOG_LEVEL = _get(SCIPION_LOG_LEVEL, 'INFO')
144
- "Default logging level. String among CRITICAL, ERROR, WARNING, INFO, DEBUG, NOTSET. Default value is INFO."
221
+ SCIPION_LOG_FORMAT = _get('SCIPION_LOG_FORMAT', "%(message)s",
222
+ "str: Format for all the log lines, defaults to %(message)s. To compose the format see https://docs.python.org/3/library/logging.html#logrecord-attributes")
145
223
 
146
- NO_COLOR = _get('NO_COLOR', '')
147
- "str: Comply with https://no-color.org/ initiative. Set it to something different than '' to deactivate colors in the output."
224
+ SCIPION_LOG_LEVEL = _get(SCIPION_LOG_LEVEL, 'INFO',
225
+ "Default logging level. String among CRITICAL, ERROR, WARNING, INFO, DEBUG, NOTSET. Default value is INFO.")
148
226
 
149
- SCIPION_SCRATCH = _get(SCIPION_SCRATCH, None)
150
- "Optional. Path to a location mounted in a scratch drive (SSD,...)"
227
+ NO_COLOR = _get('NO_COLOR', '',
228
+ "str: Comply with https://no-color.org/ initiative. Set it to something different than '' to deactivate colors in the output.")
151
229
 
152
- SCIPION_TESTS_OUTPUT = _get('SCIPION_TESTS_OUTPUT', _join(SCIPION_USER_DATA, 'Tests'))
153
- "Path to a folder Where the output of the tests will be written. Defaults to SCIPION_USER_DATA/Tests."
230
+ SCIPION_SCRATCH = _get(SCIPION_SCRATCH, None,
231
+ "Optional. Path to a location mounted in a scratch drive (SSD,...)")
154
232
 
155
- SCIPION_TEST_NOSYNC = _get('SCIPION_TEST_NOSYNC', FALSE_STR) != FALSE_STR
156
- "Set it to 1, True, Yes or y to cancel test dataset synchronization. Needed when updating files in a dataset."
233
+ SCIPION_TESTS_OUTPUT = _get('SCIPION_TESTS_OUTPUT', _join(SCIPION_USER_DATA, 'Tests'),
234
+ "Path to a folder where the output of the tests will be written. Defaults to SCIPION_USER_DATA/Tests.", var_type=VarTypes.FOLDER)
157
235
 
158
- SCIPION_SUPPORT_EMAIL = _get('SCIPION_SUPPORT_EMAIL', 'scipion@cnb.csic.es')
236
+ SCIPION_TEST_NOSYNC = _get('SCIPION_TEST_NOSYNC', FALSE_STR,
237
+ "Set it to 1, True, Yes or y to cancel test dataset synchronization. Needed when updating files in a dataset.") != FALSE_STR
159
238
 
160
- SCIPION_LOGO = _get('SCIPION_LOGO', 'scipion_logo.gif')
239
+ SCIPION_SUPPORT_EMAIL = 'scipion@cnb.csic.es'
161
240
 
162
241
  # Config variables
163
- SCIPION_CONFIG = _get('SCIPION_CONFIG', 'scipion.conf')
164
- "Path to the scipion configuration file where all this variables could be defined."
242
+ SCIPION_CONFIG = _get('SCIPION_CONFIG', _join('config','scipion.conf'),
243
+ "Path to the scipion configuration file where all this variables could be defined.", var_type=VarTypes.PATH)
165
244
 
166
- SCIPION_LOCAL_CONFIG = _get('SCIPION_LOCAL_CONFIG', SCIPION_CONFIG)
167
- "Path to an optional/extra/user configuration file meant to overwrite default variables."
245
+ SCIPION_LOCAL_CONFIG = _get('SCIPION_LOCAL_CONFIG', SCIPION_CONFIG,
246
+ "Path to an optional/extra/user configuration file meant to overwrite default variables.", var_type=VarTypes.PATH)
168
247
 
169
- SCIPION_HOSTS = _get('SCIPION_HOSTS', 'hosts.conf')
170
- "Path to the host.cof file to allow scipion to use queue engines and run in HPC environments."
248
+ SCIPION_HOSTS = _get('SCIPION_HOSTS', _join('config','hosts.conf'),
249
+ "Path to the host.cof file to allow scipion to use queue engines and run in HPC environments.")
171
250
 
172
- SCIPION_PROTOCOLS = _get('SCIPION_PROTOCOLS', 'protocols.conf')
173
- ""
251
+ SCIPION_PROTOCOLS = _get('SCIPION_PROTOCOLS', _join('config','protocols.conf'),
252
+ "Custom conf file to extend the protocols tree view panel (panel on the left)")
174
253
 
175
- SCIPION_PLUGIN_JSON = _get('SCIPION_PLUGIN_JSON', None)
176
- "Optional. Path to get the json file with all the plugins available for Scipion."
254
+ SCIPION_PLUGIN_JSON = _get('SCIPION_PLUGIN_JSON', None,
255
+ "Optional. Path to get the json file with all the plugins available for Scipion.")
177
256
 
178
257
  SCIPION_PLUGIN_REPO_URL = _get('SCIPION_PLUGIN_REPO_URL',
179
- 'http://scipion.i2pc.es/getplugins/')
180
- "Url from where to get the list of plugins."
258
+ 'https://scipion.i2pc.es/getplugins/',
259
+ "Url from where to get the list of plugins.")
181
260
 
182
261
  # REMOTE Section
183
- SCIPION_URL = _get('SCIPION_URL', 'http://scipion.cnb.csic.es/downloads/scipion')
184
- SCIPION_URL_SOFTWARE = _get('SCIPION_URL_SOFTWARE', SCIPION_URL + '/software')
185
- SCIPION_URL_TESTDATA = _get('SCIPION_URL_TESTDATA', SCIPION_URL + '/data/tests')
262
+ SCIPION_URL = 'https://scipion.cnb.csic.es/downloads/scipion'
263
+ SCIPION_URL_SOFTWARE = SCIPION_URL + '/software'
264
+ SCIPION_URL_TESTDATA = SCIPION_URL + '/data/tests'
186
265
 
187
266
  # Scipion Notes
188
- SCIPION_NOTES_FILE = _get(SCIPION_NOTES_FILE, 'notes.txt')
189
- "Name of the file where to write per project notes."
267
+ SCIPION_NOTES_FILE = _get(SCIPION_NOTES_FILE, 'notes.txt',
268
+ "Name of the file where to write per project notes.")
190
269
 
191
- SCIPION_NOTES_PROGRAM = _get(SCIPION_NOTES_PROGRAM, None)
192
- "Command or program to use to open the notes file. Otherwise system will extension association will take place."
270
+ SCIPION_NOTES_PROGRAM = _get(SCIPION_NOTES_PROGRAM, None,
271
+ "Command or program to use to open the notes file. Otherwise system will extension association will take place.")
193
272
 
194
273
  SCIPION_NOTES_ARGS = _get(SCIPION_NOTES_ARGS, None)
195
274
 
196
275
  # Aspect
197
- SCIPION_FONT_NAME = _get('SCIPION_FONT_NAME', "Helvetica")
198
- "Name of the font to use in Scipion GUI. Defaults to Helvetica."
276
+ SCIPION_FONT_NAME = _get('SCIPION_FONT_NAME', "Helvetica",
277
+ "Name of the font to use in Scipion GUI. Defaults to Helvetica.")
278
+
279
+ SCIPION_FONT_SIZE = _get('SCIPION_FONT_SIZE', SCIPION_DEFAULT_FONT_SIZE,
280
+ "Size of the 'normal' font to be used in Scipion GUI. Defaults to 10.", caster=int)
199
281
 
200
- SCIPION_FONT_SIZE = int(_get('SCIPION_FONT_SIZE', SCIPION_DEFAULT_FONT_SIZE))
201
- "Size of the 'normal' font to be used in Scipion GUI. Defaults to 10."
282
+ SCIPION_MAIN_COLOR = _get('SCIPION_MAIN_COLOR', Color.MAIN_COLOR,
283
+ "str: Main color of the GUI. Background will be white, so for better contrast choose a dark color. Probably any name here will work: https://matplotlib.org/stable/gallery/color/named_colors.html",
284
+ caster=validColor)
202
285
 
203
- SCIPION_MAIN_COLOR = _get('SCIPION_MAIN_COLOR', Color.MAIN_COLOR)
204
- "str: Main color of the GUI. Background will be white, so for better contrast choose a dark color. Probably any name here will work: https://matplotlib.org/stable/gallery/color/named_colors.html"
286
+ SCIPION_BG_COLOR = _get('SCIPION_BG_COLOR', Color.BG_COLOR,
287
+ "str: Main background color of the GUI. Default is white, chose a light one. Probably any name here will work: https://matplotlib.org/stable/gallery/color/named_colors.html",
288
+ validColor)
205
289
 
206
- SCIPION_BG_COLOR = _get('SCIPION_BG_COLOR', Color.BG_COLOR)
207
- "str: Main background color of the GUI. Default is white, chose a light one. Probably any name here will work: https://matplotlib.org/stable/gallery/color/named_colors.html"
290
+ SCIPION_CONTRAST_COLOR = _get('SCIPION_CONTRAST_COLOR', 'cyan',
291
+ "Color used to highlight features over grayscaled images.", caster=validColor)
208
292
 
209
- WIZARD_MASK_COLOR = _get('WIZARD_MASK_COLOR', '[0.125, 0.909, 0.972]')
210
- "Color to use in some wizards."
293
+ SCIPION_SPRITES_FILE = _get('SCIPION_SPRITES_FILE', _join(getResourcesPath(),'sprites.png'),
294
+ "File (png) with the icons in a collage. Default is found at pyworkflow/resources/sprites.png. And a GIMP file could be found at the same folder in the github repo.")
295
+
296
+ SCIPION_SHOW_TEXT_IN_TOOLBAR = _get('SCIPION_SHOW_TEXT_IN_TOOLBAR', TRUE_STR,
297
+ "Define it to anything else except False to show the label of the icons. It will take more space.") == TRUE_STR
298
+
299
+ SCIPION_ICON_ZOOM = _get('SCIPION_ICON_ZOOM', 50,
300
+ "Define it to anything else except False to show the label of the icons. It will take more space.", var_type=VarTypes.INTEGER, caster=int)
211
301
 
212
302
  # Notification
213
- SCIPION_NOTIFY = _get('SCIPION_NOTIFY', TRUE_STR) == TRUE_STR
214
- "If set to False, Scipion developers will know almost nothing about Scipion usage and will have less information to improve it."
303
+ SCIPION_NOTIFY = _get('SCIPION_NOTIFY', TRUE_STR,
304
+ "If set to False, Scipion developers will know almost nothing about Scipion usage and will have less information to improve it.") == TRUE_STR
215
305
 
216
306
  # *** Execution variables ***
217
- SCIPION_CWD = _get('SCIPION_CWD', os.path.abspath(os.getcwd()))
218
- "Directory when scipion was launched"
307
+ SCIPION_CWD = _get('SCIPION_CWD', os.path.abspath(os.getcwd()),
308
+ "Directory when scipion was launched")
219
309
 
220
- SCIPION_GUI_REFRESH_IN_THREAD = _get('SCIPION_GUI_REFRESH_IN_THREAD', FALSE_STR) != FALSE_STR
221
- "True to refresh the runs graph with a thread. Unstable."
310
+ SCIPION_GUI_REFRESH_IN_THREAD = _get('SCIPION_GUI_REFRESH_IN_THREAD', FALSE_STR,
311
+ "True to refresh the runs graph with a thread. Unstable.") != FALSE_STR
222
312
 
223
- SCIPION_GUI_REFRESH_INITIAL_WAIT = int(_get("SCIPION_GUI_REFRESH_INITIAL_WAIT", 5))
224
- "Seconds to wait after a manual refresh"
313
+ SCIPION_GUI_REFRESH_INITIAL_WAIT = _get("SCIPION_GUI_REFRESH_INITIAL_WAIT", 5,
314
+ "Seconds to wait after a manual refresh", caster=int)
225
315
 
226
- SCIPION_GUI_CANCEL_AUTO_REFRESH = _get("SCIPION_GUI_CANCEL_AUTO_REFRESH",FALSE_STR) != FALSE_STR
227
- "Set it to True to cancel automatic refresh of the runs."
316
+ SCIPION_GUI_CANCEL_AUTO_REFRESH = _get("SCIPION_GUI_CANCEL_AUTO_REFRESH",FALSE_STR,
317
+ "Set it to True to cancel automatic refresh of the runs.") != FALSE_STR
228
318
 
229
319
  # Cancel shutil fast copy. In GPFS, shutil.copy does fail when trying a fastcopy and does not
230
- # fallback on the slow copy. For legacy reasons None is also False.
231
- SCIPION_CANCEL_FASTCOPY = _get('SCIPION_CANCEL_FASTCOPY', FALSE_STR) not in [NONE_STR, FALSE_STR]
320
+ # fall back on the slow copy. For legacy reasons None is also False.
321
+ SCIPION_CANCEL_FASTCOPY = _get('SCIPION_CANCEL_FASTCOPY', FALSE_STR,
232
322
  "Cancel fast copy done by shutil (copying files) when it fails. Has happened in GPFS environments. Defaults to False. None is also False otherwise fastcopy is cancelled."
323
+ ) not in [NONE_STR, FALSE_STR]
233
324
 
234
325
  # Priority package list: This variable is used in the view protocols in
235
326
  # order to load first the plugins that contains the main protocols.conf
@@ -237,32 +328,32 @@ class Config:
237
328
  # duplicating all the sections in all plugins. Scipion app is currently defining it for em tomo and chem
238
329
  SCIPION_PRIORITY_PACKAGE_LIST = _get('SCIPION_PRIORITY_PACKAGE_LIST', EMPTY_STR)
239
330
 
240
- SCIPION_STEPS_CHECK_SEC = int(_get('SCIPION_STEPS_CHECK_SEC', 5))
241
- "Number of seconds to wait before checking if new input is available in streamified protocols."
331
+ SCIPION_STEPS_CHECK_SEC = _get('SCIPION_STEPS_CHECK_SEC', 5,
332
+ "Number of seconds to wait before checking if new input is available in streamified protocols.", caster=int)
242
333
 
243
- SCIPION_UPDATE_SET_ATTEMPTS = int(_get('SCIPION_UPDATE_SET_ATTEMPTS', 3))
244
- "Number of attempts to modify the protocol output before failing. The default value is 3"
334
+ SCIPION_UPDATE_SET_ATTEMPTS = _get('SCIPION_UPDATE_SET_ATTEMPTS', 3,
335
+ "Number of attempts to modify the protocol output before failing. The default value is 3", caster=int)
245
336
 
246
- SCIPION_UPDATE_SET_ATTEMPT_WAIT = int(_get('SCIPION_UPDATE_SET_ATTEMPT_WAIT', 2))
247
- "Time in seconds to wait until the next attempt when checking new outputs. The default value is 2 seconds"
337
+ SCIPION_UPDATE_SET_ATTEMPT_WAIT = _get('SCIPION_UPDATE_SET_ATTEMPT_WAIT', 2,
338
+ "Time in seconds to wait until the next attempt when checking new outputs. The default value is 2 seconds", caster=int)
248
339
 
249
- SCIPION_USE_QUEUE = _get("SCIPION_USE_QUEUE", FALSE_STR) != FALSE_STR
250
- "Default value for using the queue. By default is False. ANY value will be True except and empty value. \"False\" or \"0\" will be True too."
340
+ SCIPION_USE_QUEUE = _get("SCIPION_USE_QUEUE", FALSE_STR,
341
+ "Default value for using the queue. By default is False. ANY value will be True except and empty value. \"False\" or \"0\" will be True too.")!= FALSE_STR
251
342
 
252
- SCIPION_DEFAULT_EXECUTION_ACTION = int(_get('SCIPION_DEFAULT_EXECUTION_ACTION', DEFAULT_EXECUTION_ACTION_ASK))
343
+ SCIPION_DEFAULT_EXECUTION_ACTION = _get('SCIPION_DEFAULT_EXECUTION_ACTION', DEFAULT_EXECUTION_ACTION_ASK,
253
344
  """Ask if you want to launch a single protocol or a sub-workflow. The default value is 1
254
345
  1: Scipion always ask
255
346
  2: Run a single protocol
256
- 3: Run a sub-workflow """
347
+ 3: Run a sub-workflow """, caster=int)
257
348
 
258
349
  try:
259
- VIEWERS = ast.literal_eval(_get('VIEWERS', "{}"))
350
+ VIEWERS = ast.literal_eval(_get('VIEWERS', "{}", "Json string to define which viewer are the default ones per output type."))
260
351
  except Exception as e:
261
352
  VIEWERS = {}
262
353
  logger.error("ERROR loading preferred viewers, VIEWERS variable will be ignored", exc_info=e)
263
354
 
264
- SCIPION_DOMAIN = _get(SCIPION_DOMAIN, None)
265
- SCIPION_TESTS_CMD = _get(SCIPION_TESTS_CMD, getTestsScript())
355
+ SCIPION_DOMAIN = _get(SCIPION_DOMAIN, None, "Domain base class. Ignore.")
356
+ SCIPION_TESTS_CMD = _get(SCIPION_TESTS_CMD, getTestsScript(), "Command to run tests")
266
357
 
267
358
  # ---- Getters ---- #
268
359
  # Getters are alternatives to offer a variable, but preventing it to be stored in the config
@@ -306,16 +397,10 @@ class Config:
306
397
  for name, value in vars(baseCls).items():
307
398
  # Skip methods and internal attributes starting with __
308
399
  # (e.g __doc__, __module__, etc)
309
- if (isinstance(value, str) or isinstance(value, int)) and not name.startswith('__'):
400
+ if isinstance(value, (str, int)) and not name.startswith('__'):
310
401
  configVars[name] = str(value)
311
402
  return configVars
312
403
 
313
- @classmethod
314
- def printVars(cls):
315
- """ Print the variables' dict, mostly for debugging. """
316
- from .utils import prettyDict
317
- prettyDict(cls.getVars())
318
-
319
404
  @classmethod
320
405
  def getDomain(cls):
321
406
  """ Import domain module from path or name defined in SCIPION_DOMAIN.
@@ -360,7 +445,8 @@ class Config:
360
445
 
361
446
  @staticmethod
362
447
  def debugSQLOn():
363
- return Config.debugOn()
448
+ from .utils import envVarOn
449
+ return bool(envVarOn(SCIPION_DEBUG_SQLITE))
364
450
 
365
451
  @staticmethod
366
452
  def toggleDebugSQL():
@@ -377,7 +463,9 @@ class Config:
377
463
 
378
464
  @classmethod
379
465
  def getWizardMaskColor(cls):
380
- return json.loads(cls.WIZARD_MASK_COLOR)
466
+ """ Color is a name"""
467
+ from matplotlib.colors import to_rgb
468
+ return list(to_rgb(cls.SCIPION_CONTRAST_COLOR))
381
469
 
382
470
  @classmethod
383
471
  def getPriorityPackageList(cls):
@@ -409,16 +497,9 @@ class Config:
409
497
  """ Returns a color lighter than the SCIPION_MAIN_COLOR"""
410
498
 
411
499
  if cls.__activeColor is None:
412
- import matplotlib.colors
413
500
  from pyworkflow.utils import lighter, rgb_to_hex
414
- try:
415
- rgb_main = matplotlib.colors.to_rgb(cls.SCIPION_MAIN_COLOR)
416
- except Exception:
417
- logger.error("Cannot convert SCIPION_MAIN_COLOR (%s) string to a color to compute the lighter color."
418
- " Falling back to %s" % (Config.SCIPION_MAIN_COLOR, Color.MAIN_COLOR))
419
- cls.SCIPION_MAIN_COLOR = Color.MAIN_COLOR
420
- rgb_main = matplotlib.colors.to_rgb(cls.SCIPION_MAIN_COLOR)
421
-
501
+ from matplotlib.colors import to_rgb
502
+ rgb_main = to_rgb(cls.SCIPION_MAIN_COLOR)
422
503
  rgb_main = (rgb_main[0] * 255, rgb_main[1] * 255, rgb_main[2] * 255)
423
504
  rgb_active = lighter(rgb_main, 0.3)
424
505
  cls.__activeColor = rgb_to_hex(rgb_active)
@@ -42,7 +42,7 @@ VERSION_1 = '1.0.0'
42
42
  VERSION_1_1 = '1.1.0'
43
43
  VERSION_1_2 = '1.2.0'
44
44
  VERSION_2_0 = '2.0.0'
45
- VERSION_3_0 = '3.4.0'
45
+ VERSION_3_0 = '3.6.0'
46
46
 
47
47
  # For a new release, define a new constant and assign it to LAST_VERSION
48
48
  # The existing one has to be added to OLD_VERSIONS list.
@@ -182,7 +182,7 @@ class DOCSITEURLS:
182
182
  DOCS = HOME + 'docs/'
183
183
  CONFIG = DOCS + 'scipion-modes/scipion-configuration.html'
184
184
  CONFIG_SECTION = CONFIG + '#%s'
185
- CONTACTUS = 'http://scipion.i2pc.es/contact'
185
+ CONTACTUS = 'https://scipion.i2pc.es/contact'
186
186
  USER = DOCS + 'user/'
187
187
  GUI = USER + 'scipion-gui.html'
188
188
  WAIT_FOR = GUI + '#waiting-for-other-protocols'
@@ -200,6 +200,8 @@ class TK:
200
200
  TREEVIEW_CLOSE = '<<TreeviewClose>>'
201
201
 
202
202
 
203
+ HELP_DURATION_FORMAT = "Duration format example: 1d 20h 30m 30s --> 1 day 20 hours 30 minutes and 30 seconds"
204
+
203
205
  # Run protocol modes
204
206
  DEFAULT_EXECUTION_ACTION_ASK = 1
205
207
  DEFAULT_EXECUTION_ACTION_SINGLE = 2
@@ -34,6 +34,7 @@ import stat
34
34
  import tkinter as tk
35
35
  import time
36
36
  import logging
37
+
37
38
  logger = logging.getLogger(__name__)
38
39
 
39
40
  import pyworkflow.utils as pwutils
@@ -124,7 +125,7 @@ class ObjectBrowser(tk.Frame):
124
125
  img, desc = self.treeProvider.getObjectPreview(obj)
125
126
  # Update image preview
126
127
  if self.showPreviewTop:
127
- if isinstance(img, str):
128
+ if isinstance(img, (str, pwutils.SpriteImage)):
128
129
  img = self.getImage(img)
129
130
  if img is None:
130
131
  img = self.noImage
@@ -331,7 +332,7 @@ class FileTreeProvider(TreeProvider):
331
332
  # All ok...add item.
332
333
  fileInfoList.append(FileInfo(self._currentDir, f))
333
334
  except Exception as e:
334
- logger.error("Can't list files at " + self._currentDir, e)
335
+ logger.info("Can't list files at " + self._currentDir, e)
335
336
 
336
337
  # Sort objects
337
338
  fileInfoList.sort(key=self.fileKey, reverse=not self.isSortingAscending())
@@ -360,7 +361,7 @@ SELECT_PATH = 3 # Can be either file or folder
360
361
 
361
362
 
362
363
  class FileBrowser(ObjectBrowser):
363
- """ The FileBrowser is a particular class of ObjectBrowser
364
+ """ The FileBrowser is a particular class of ObjectBrowser (Tk.Frame)
364
365
  where the "objects" are just files and directories.
365
366
  """
366
367
 
@@ -416,13 +417,13 @@ class FileBrowser(ObjectBrowser):
416
417
  # focuses on the browser in order to allow to move with the keyboard
417
418
  self._goDir(os.path.abspath(initialDir))
418
419
 
419
- if selectionType == SELECT_NONE:
420
- selectButton = None
421
-
422
420
  buttonsFrame = tk.Frame(self)
423
421
  self._fillButtonsFrame(buttonsFrame)
424
422
  buttonsFrame.grid(row=1, column=0)
425
423
 
424
+ # Callback to be called "on Select" button key press
425
+ self.onSelect=None
426
+
426
427
  def _showInfo(self, msg):
427
428
  """ Default way (logger.info to console) to show a message with a given info.
428
429
  """
@@ -634,7 +635,10 @@ class FileBrowser(ObjectBrowser):
634
635
  self._lastSelected = self.getSelected()
635
636
 
636
637
  if self._lastSelected is not None:
637
- self.onSelect(self._lastSelected)
638
+ if self.onSelect:
639
+ self.onSelect(self._lastSelected)
640
+ else:
641
+ self.onClose()
638
642
  else:
639
643
  self.showInfo('Select a valid file/folder')
640
644
 
@@ -686,6 +690,7 @@ def isStandardImage(filename):
686
690
  class FileBrowserWindow(BrowserWindow):
687
691
  """ Windows to hold a file browser frame inside. """
688
692
 
693
+ lastValue=None
689
694
  def __init__(self, title, master=None, path=None,
690
695
  onSelect=None, shortCuts=None, **kwargs):
691
696
  BrowserWindow.__init__(self, title, master, **kwargs)
@@ -706,6 +711,8 @@ class FileBrowserWindow(BrowserWindow):
706
711
  def getEntryValue(self):
707
712
  return self.browser.getEntryValue()
708
713
 
714
+ def getLastSelection(self):
715
+ return self.browser._lastSelected.getPath()
709
716
  def getCurrentDir(self):
710
717
  return self.browser.getCurrentDir()
711
718
 
@@ -716,13 +723,4 @@ class FileBrowserWindow(BrowserWindow):
716
723
  '.txt', '.log', '.out', '.err', '.stdout', '.stderr', '.emx',
717
724
  '.json', '.xml', '.pam')
718
725
  register(TextFileHandler(pwutils.Icon.PYTHON_FILE), '.py')
719
- register(TextFileHandler(pwutils.Icon.JAVA_FILE), '.java')
720
- register(SqlFileHandler(), '.sqlite', '.db')
721
- # register(MdFileHandler(), '.xmd', '.star', '.pos', '.ctfparam', '.doc')
722
- # register(ParticleFileHandler(),
723
- # '.xmp', '.tif', '.tiff', '.spi', '.mrc', '.map', '.raw',
724
- # '.inf', '.dm3', '.em', '.pif', '.psd', '.spe', '.ser', '.img',
725
- # '.hed', *STANDARD_IMAGE_EXTENSIONS)
726
- # register(VolFileHandler(), '.vol')
727
- # register(StackHandler(), '.stk', '.mrcs', '.st', '.pif', '.dm4')
728
- # register(ChimeraHandler(), '.bild')
726
+ register(SqlFileHandler(), '.sqlite', '.db')