scipion-pyworkflow 3.10.5__py3-none-any.whl → 3.11.0__py3-none-any.whl

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 (127) hide show
  1. pyworkflow/config.py +131 -67
  2. pyworkflow/constants.py +12 -2
  3. pyworkflow/object.py +3 -2
  4. pyworkflow/plugin.py +93 -44
  5. pyworkflow/project/scripts/fix_links.py +4 -1
  6. pyworkflow/resources/showj/arrowDown.png +0 -0
  7. pyworkflow/resources/showj/arrowUp.png +0 -0
  8. pyworkflow/resources/showj/background_section.png +0 -0
  9. pyworkflow/resources/showj/colRowModeOff.png +0 -0
  10. pyworkflow/resources/showj/colRowModeOn.png +0 -0
  11. pyworkflow/resources/showj/delete.png +0 -0
  12. pyworkflow/resources/showj/doc_icon.png +0 -0
  13. pyworkflow/resources/showj/download_icon.png +0 -0
  14. pyworkflow/resources/showj/enabled_gallery.png +0 -0
  15. pyworkflow/resources/showj/galleryViewOff.png +0 -0
  16. pyworkflow/resources/showj/galleryViewOn.png +0 -0
  17. pyworkflow/resources/showj/goto.png +0 -0
  18. pyworkflow/resources/showj/menu.png +0 -0
  19. pyworkflow/resources/showj/separator.png +0 -0
  20. pyworkflow/resources/showj/tableViewOff.png +0 -0
  21. pyworkflow/resources/showj/tableViewOn.png +0 -0
  22. pyworkflow/resources/showj/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  23. pyworkflow/resources/showj/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  24. pyworkflow/resources/showj/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  25. pyworkflow/resources/showj/volumeOff.png +0 -0
  26. pyworkflow/resources/showj/volumeOn.png +0 -0
  27. pyworkflow/viewer.py +23 -1
  28. pyworkflowtests/objects.py +2 -2
  29. pyworkflowtests/protocols.py +1 -3
  30. {scipion_pyworkflow-3.10.5.dist-info → scipion_pyworkflow-3.11.0.dist-info}/METADATA +21 -25
  31. scipion_pyworkflow-3.11.0.dist-info/RECORD +71 -0
  32. {scipion_pyworkflow-3.10.5.dist-info → scipion_pyworkflow-3.11.0.dist-info}/WHEEL +1 -1
  33. scipion_pyworkflow-3.11.0.dist-info/entry_points.txt +2 -0
  34. pyworkflow/apps/__init__.py +0 -29
  35. pyworkflow/apps/pw_manager.py +0 -37
  36. pyworkflow/apps/pw_plot.py +0 -51
  37. pyworkflow/apps/pw_project.py +0 -113
  38. pyworkflow/apps/pw_protocol_list.py +0 -143
  39. pyworkflow/apps/pw_protocol_run.py +0 -51
  40. pyworkflow/apps/pw_run_tests.py +0 -267
  41. pyworkflow/apps/pw_schedule_run.py +0 -322
  42. pyworkflow/apps/pw_sleep.py +0 -37
  43. pyworkflow/apps/pw_sync_data.py +0 -439
  44. pyworkflow/apps/pw_viewer.py +0 -78
  45. pyworkflow/gui/__init__.py +0 -36
  46. pyworkflow/gui/browser.py +0 -726
  47. pyworkflow/gui/canvas.py +0 -1190
  48. pyworkflow/gui/dialog.py +0 -977
  49. pyworkflow/gui/form.py +0 -2637
  50. pyworkflow/gui/graph.py +0 -247
  51. pyworkflow/gui/graph_layout.py +0 -271
  52. pyworkflow/gui/gui.py +0 -566
  53. pyworkflow/gui/matplotlib_image.py +0 -233
  54. pyworkflow/gui/plotter.py +0 -247
  55. pyworkflow/gui/project/__init__.py +0 -25
  56. pyworkflow/gui/project/base.py +0 -192
  57. pyworkflow/gui/project/constants.py +0 -139
  58. pyworkflow/gui/project/labels.py +0 -205
  59. pyworkflow/gui/project/project.py +0 -492
  60. pyworkflow/gui/project/searchprotocol.py +0 -154
  61. pyworkflow/gui/project/searchrun.py +0 -181
  62. pyworkflow/gui/project/steps.py +0 -171
  63. pyworkflow/gui/project/utils.py +0 -332
  64. pyworkflow/gui/project/variables.py +0 -179
  65. pyworkflow/gui/project/viewdata.py +0 -472
  66. pyworkflow/gui/project/viewprojects.py +0 -510
  67. pyworkflow/gui/project/viewprotocols.py +0 -2093
  68. pyworkflow/gui/project/viewprotocols_extra.py +0 -560
  69. pyworkflow/gui/text.py +0 -771
  70. pyworkflow/gui/tooltip.py +0 -185
  71. pyworkflow/gui/tree.py +0 -684
  72. pyworkflow/gui/widgets.py +0 -307
  73. pyworkflow/mapper/__init__.py +0 -26
  74. pyworkflow/mapper/mapper.py +0 -222
  75. pyworkflow/mapper/sqlite.py +0 -1578
  76. pyworkflow/mapper/sqlite_db.py +0 -145
  77. pyworkflow/project/__init__.py +0 -31
  78. pyworkflow/project/config.py +0 -454
  79. pyworkflow/project/manager.py +0 -180
  80. pyworkflow/project/project.py +0 -2010
  81. pyworkflow/protocol/__init__.py +0 -38
  82. pyworkflow/protocol/bibtex.py +0 -48
  83. pyworkflow/protocol/constants.py +0 -87
  84. pyworkflow/protocol/executor.py +0 -455
  85. pyworkflow/protocol/hosts.py +0 -313
  86. pyworkflow/protocol/launch.py +0 -270
  87. pyworkflow/protocol/package.py +0 -42
  88. pyworkflow/protocol/params.py +0 -741
  89. pyworkflow/protocol/protocol.py +0 -2582
  90. pyworkflow/tests/__init__.py +0 -29
  91. pyworkflow/tests/test_utils.py +0 -25
  92. pyworkflow/tests/tests.py +0 -341
  93. pyworkflow/utils/__init__.py +0 -38
  94. pyworkflow/utils/dataset.py +0 -414
  95. pyworkflow/utils/echo.py +0 -104
  96. pyworkflow/utils/graph.py +0 -169
  97. pyworkflow/utils/log.py +0 -284
  98. pyworkflow/utils/path.py +0 -528
  99. pyworkflow/utils/process.py +0 -132
  100. pyworkflow/utils/profiler.py +0 -92
  101. pyworkflow/utils/progressbar.py +0 -154
  102. pyworkflow/utils/properties.py +0 -631
  103. pyworkflow/utils/reflection.py +0 -129
  104. pyworkflow/utils/utils.py +0 -879
  105. pyworkflow/utils/which.py +0 -229
  106. pyworkflow/webservices/__init__.py +0 -8
  107. pyworkflow/webservices/config.py +0 -11
  108. pyworkflow/webservices/notifier.py +0 -162
  109. pyworkflow/webservices/repository.py +0 -59
  110. pyworkflow/webservices/workflowhub.py +0 -74
  111. pyworkflowtests/tests/__init__.py +0 -0
  112. pyworkflowtests/tests/test_canvas.py +0 -72
  113. pyworkflowtests/tests/test_domain.py +0 -45
  114. pyworkflowtests/tests/test_logs.py +0 -74
  115. pyworkflowtests/tests/test_mappers.py +0 -392
  116. pyworkflowtests/tests/test_object.py +0 -507
  117. pyworkflowtests/tests/test_project.py +0 -42
  118. pyworkflowtests/tests/test_protocol_execution.py +0 -135
  119. pyworkflowtests/tests/test_protocol_export.py +0 -78
  120. pyworkflowtests/tests/test_protocol_output.py +0 -158
  121. pyworkflowtests/tests/test_streaming.py +0 -47
  122. pyworkflowtests/tests/test_utils.py +0 -210
  123. scipion_pyworkflow-3.10.5.dist-info/RECORD +0 -140
  124. scipion_pyworkflow-3.10.5.dist-info/dependency_links.txt +0 -1
  125. scipion_pyworkflow-3.10.5.dist-info/entry_points.txt +0 -5
  126. {scipion_pyworkflow-3.10.5.dist-info → scipion_pyworkflow-3.11.0.dist-info/licenses}/LICENSE.txt +0 -0
  127. {scipion_pyworkflow-3.10.5.dist-info → scipion_pyworkflow-3.11.0.dist-info}/top_level.txt +0 -0
@@ -1,139 +0,0 @@
1
- # **************************************************************************
2
- # *
3
- # * Authors: J.M. De la Rosa Trevin (jmdelarosa@cnb.csic.es)
4
- # *
5
- # * Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
6
- # *
7
- # * This program is free software; you can redistribute it and/or modify
8
- # * it under the terms of the GNU General Public License as published by
9
- # * the Free Software Foundation; either version 3 of the License, or
10
- # * (at your option) any later version.
11
- # *
12
- # * This program is distributed in the hope that it will be useful,
13
- # * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- # * GNU General Public License for more details.
16
- # *
17
- # * You should have received a copy of the GNU General Public License
18
- # * along with this program; if not, write to the Free Software
19
- # * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20
- # * 02111-1307 USA
21
- # *
22
- # * All comments concerning this program package may be sent to the
23
- # * e-mail address 'scipion@cnb.csic.es'
24
- # *
25
- # **************************************************************************
26
-
27
-
28
- from pyworkflow.protocol import (STATUS_SAVED, STATUS_LAUNCHED, STATUS_RUNNING,
29
- STATUS_FINISHED, STATUS_FAILED,
30
- STATUS_INTERACTIVE, STATUS_ABORTED,
31
- STATUS_SCHEDULED)
32
-
33
- from pyworkflow.utils.properties import Message, Icon, KEYSYM
34
-
35
- STATUS_COLORS = {
36
- STATUS_SAVED: '#D9F1FA',
37
- STATUS_LAUNCHED: '#D9F1FA',
38
- STATUS_RUNNING: '#FCCE62',
39
- STATUS_FINISHED: '#D2F5CB',
40
- STATUS_FAILED: '#F5CCCB',
41
- STATUS_INTERACTIVE: '#F3F5CB',
42
- STATUS_ABORTED: '#F5CCCB',
43
- STATUS_SCHEDULED: '#F3F5CB'
44
- }
45
-
46
- # For protocols with warnings
47
- WARNING_COLOR = '#848484'
48
-
49
- ACTION_NEW = Message.LABEL_NEW
50
- ACTION_EDIT = Message.LABEL_EDIT
51
- ACTION_RENAME = Message.LABEL_RENAME
52
- ACTION_SELECT_FROM = Message.LABEL_SELECT_FROM
53
- ACTION_SELECT_TO = Message.LABEL_SELECT_TO
54
- ACTION_COPY = Message.LABEL_COPY
55
- ACTION_PASTE = Message.LABEL_PASTE
56
- ACTION_DUPLICATE = Message.LABEL_DUPLICATE
57
- ACTION_DELETE = Message.LABEL_DELETE
58
- ACTION_REFRESH = Message.LABEL_REFRESH
59
- ACTION_STEPS = Message.LABEL_STEPS
60
- ACTION_BROWSE = Message.LABEL_BROWSE
61
- ACTION_DB = Message.LABEL_DB
62
- ACTION_TREE = Message.LABEL_TREE
63
- ACTION_STOP = Message.LABEL_STOP
64
- ACTION_DEFAULT = Message.LABEL_DEFAULT
65
- ACTION_CONTINUE = Message.LABEL_CONTINUE
66
- ACTION_RESULTS = Message.LABEL_ANALYZE
67
- ACTION_EXPORT = Message.LABEL_EXPORT
68
- ACTION_EXPORT_UPLOAD = Message.LABEL_EXPORT_UPLOAD
69
- ACTION_SWITCH_VIEW = 'Switch_View'
70
- ACTION_COLLAPSE = 'Collapse'
71
- ACTION_EXPAND = 'Expand'
72
- ACTION_LABELS = 'Labels'
73
- ACTION_RESTART_WORKFLOW = Message.LABEL_RESTART_WORKFLOW
74
- ACTION_CONTINUE_WORKFLOW = Message.LABEL_CONTINUE_WORKFLOW
75
- ACTION_STOP_WORKFLOW = Message.LABEL_STOP_WORKFLOW
76
- ACTION_RESET_WORKFLOW = Message.LABEL_RESET_WORKFLOW
77
- ACTION_SEARCH = 'Search'
78
-
79
- ActionIcons = {
80
- ACTION_NEW: Icon.ACTION_NEW,
81
- ACTION_EDIT: Icon.ACTION_EDIT,
82
- ACTION_SELECT_FROM: Icon.ACTION_SELECT_FROM,
83
- ACTION_SELECT_TO: Icon.ACTION_SELECT_TO,
84
- ACTION_DUPLICATE: Icon.ACTION_DUPLICATE,
85
- ACTION_COPY: Icon.ACTION_COPY,
86
- ACTION_PASTE:Icon.ACTION_PASTE,
87
- ACTION_DELETE: Icon.ACTION_DELETE,
88
- ACTION_REFRESH: Icon.ACTION_REFRESH,
89
- ACTION_RENAME: Icon.ACTION_RENAME,
90
- ACTION_STEPS: Icon.CODE_BRANCH,
91
- ACTION_BROWSE: Icon.ACTION_BROWSE,
92
- ACTION_DB: Icon.ACTION_DB,
93
- ACTION_TREE: None, # should be set
94
- ACTION_STOP: Icon.ACTION_STOP,
95
- ACTION_CONTINUE: Icon.ACTION_CONTINUE,
96
- ACTION_RESULTS: Icon.ACTION_RESULTS,
97
- ACTION_EXPORT: Icon.ACTION_EXPORT,
98
- ACTION_EXPORT_UPLOAD: Icon.ACTION_EXPORT_UPLOAD,
99
- ACTION_COLLAPSE: Icon.ACTION_COLLAPSE,
100
- ACTION_EXPAND: Icon.ACTION_EXPAND,
101
- ACTION_LABELS: Icon.TAGS,
102
- ACTION_RESTART_WORKFLOW: Icon.BACKWARD,
103
- ACTION_CONTINUE_WORKFLOW: Icon.ACTION_CONTINUE,
104
- ACTION_STOP_WORKFLOW: Icon.ACTION_STOP_WORKFLOW,
105
- ACTION_RESET_WORKFLOW: Icon.BROOM,
106
- ACTION_SEARCH: Icon.ACTION_SEARCH,
107
- }
108
-
109
- # TODO: Centralize this and the 2 above collections
110
- ActionShortCuts = {
111
- ACTION_NEW: "<Control-f>",
112
- # F keys
113
- ACTION_RENAME: "<F2>",
114
- ACTION_REFRESH: "<F5>",
115
- # Letter keys, uppercase first, sorted
116
- ACTION_COLLAPSE: "-",
117
- ACTION_EXPAND: "+",
118
- ACTION_RESULTS: "a",
119
- ACTION_BROWSE: "b",
120
- ACTION_CONTINUE_WORKFLOW:"c",
121
- ACTION_DB: "d",
122
- ACTION_EDIT: "e",
123
- ACTION_SELECT_FROM: "f",
124
- ACTION_LABELS: "l",
125
- ACTION_TREE: "o",
126
- ACTION_RESTART_WORKFLOW: "R",
127
- ACTION_RESET_WORKFLOW:"r",
128
- ACTION_STEPS: "S",
129
- ACTION_STOP: "s",
130
- ACTION_SELECT_TO: "t",
131
- # Control +, sorted
132
- ACTION_COPY: "<Control-c>",
133
- ACTION_DUPLICATE: "<Control-d>",
134
- ACTION_PASTE: "<Control-v>",
135
- ACTION_STOP_WORKFLOW: "<Control-s>",
136
- ACTION_DELETE: "<Delete>",
137
-
138
-
139
- }
@@ -1,205 +0,0 @@
1
- # **************************************************************************
2
- # *
3
- # * Authors: J.M. De la Rosa Trevin (jmdelarosa@cnb.csic.es)
4
- # *
5
- # * Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
6
- # *
7
- # * This program is free software; you can redistribute it and/or modify
8
- # * it under the terms of the GNU General Public License as published by
9
- # * the Free Software Foundation; either version 3 of the License, or
10
- # * (at your option) any later version.
11
- # *
12
- # * This program is distributed in the hope that it will be useful,
13
- # * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- # * GNU General Public License for more details.
16
- # *
17
- # * You should have received a copy of the GNU General Public License
18
- # * along with this program; if not, write to the Free Software
19
- # * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20
- # * 02111-1307 USA
21
- # *
22
- # * All comments concerning this program package may be sent to the
23
- # * e-mail address 'scipion@cnb.csic.es'
24
- # *
25
- # **************************************************************************
26
- """
27
- Tree widget implementation.
28
- """
29
-
30
- import tkinter as tk
31
-
32
-
33
- from pyworkflow import Config
34
- from pyworkflow.project import Label
35
- from pyworkflow.gui import Icon, configureWeigths, getDefaultFont
36
- from pyworkflow.gui.tree import TreeProvider
37
- import pyworkflow.gui.dialog as dialog
38
-
39
-
40
- class LabelsTreeProvider(TreeProvider):
41
- """ Populate Tree from Labels. """
42
- def __init__(self, objList=None):
43
- TreeProvider.__init__(self)
44
- self.objList = objList
45
- self._parentDict = {}
46
-
47
- def getColumns(self):
48
- return [('name', 300), ('color', 150)]
49
-
50
- def getObjectInfo(self, label:Label):
51
-
52
- return {'key': label.getName(), 'parent': None,
53
- 'text': label.getName(), 'values': (label.getColor()),
54
- 'tags': label.getColor()}
55
-
56
- def getObjectPreview(self, obj):
57
- return None, None
58
-
59
- def getObjectActions(self, obj):
60
- return []
61
-
62
- def _getObjectList(self):
63
- """Retrieve the object list"""
64
- return self.objList
65
-
66
- def getObjects(self):
67
- objList = self._getObjectList()
68
- return objList
69
-
70
- def configureTags(self, tree):
71
- for label in self.getObjects():
72
- tree.tag_configure(label.getColor(), background=label.getColor())
73
-
74
-
75
- class LabelsDialog(dialog.ToolbarListDialog):
76
- """
77
- This class extend from ListDialog to allow an
78
- extra toolbar to handle operations over the elements
79
- in the list (e.g. Edit, New, Delete).
80
- """
81
- def __init__(self, parent, labels, **kwargs):
82
- """ From kwargs:
83
- message: message tooltip to show when browsing.
84
- selected: the item that should be selected.
85
- validateSelectionCallback:
86
- a callback function to validate selected items.
87
- allowSelect: if set to False, the 'Select' button will not
88
- be shown.
89
- """
90
- self.labels = labels
91
- toolbarButtons = [
92
- dialog.ToolbarButton('Add', self._addLabel, Icon.ACTION_NEW),
93
- dialog.ToolbarButton('Edit', self._editLabel, Icon.ACTION_EDIT),
94
- dialog.ToolbarButton('Delete', self._deleteLabel, Icon.ACTION_DELETE)
95
- ]
96
-
97
- helpMsg ="Select the label to edit or delete. Selected labels will be assigned to selected protocols." \
98
- "\nUse 'Control' key for multiple selection. Do not select any label to clear the labels of selected protocols."
99
-
100
- dialog.ToolbarListDialog.__init__(self, parent,
101
- "Manage labels",
102
- LabelsTreeProvider(labels),
103
- helpMsg,
104
- toolbarButtons,
105
- allowsEmptySelection=True,
106
- itemDoubleClick=self._editLabel,
107
- cancelButton=False,
108
- **kwargs)
109
-
110
- def _newColor(self):
111
- """ Pick a color by default for a given label from a predefined list.
112
- Check that the color have not been used by other label.
113
- """
114
- colors = ["#e57373", "#4fc3f7", "#81c784", "#ff8a65", "#9575cd",
115
- "#a1887f", "#ffd54f", "#dce775", "#4db6ac"]
116
-
117
- for c in colors:
118
- if all(l.getColor().lower() != c for l in self.labels):
119
- return c
120
-
121
- return 'red'
122
-
123
- def _addLabel(self, e=None):
124
- label = Label(color=self._newColor())
125
- dlg = EditLabelDialog(self, "Add label", label)
126
- if dlg.resultYes():
127
- self.labels.addLabel(label)
128
- self.tree.update()
129
-
130
- def _editLabel(self, e=None):
131
- selection = self.tree.getSelectedObjects()
132
- if selection:
133
- label = selection[0]
134
- dlg = EditLabelDialog(self, "Edit label", label)
135
- if dlg.resultYes():
136
- self.tree.update()
137
-
138
- def _deleteLabel(self, e=None):
139
- selection = self.tree.getSelectedObjects()
140
- if selection:
141
- labelsStr = '\n'.join('- %s' % l.getName() for l in selection)
142
- if dialog.askYesNo("Delete a label",
143
- "Are you sure to delete the "
144
- "following label(s)?\n %s" % labelsStr, self):
145
- for label in selection:
146
- self.labels.deleteLabel(label)
147
- self.tree.update()
148
-
149
-
150
- class EditLabelDialog(dialog.Dialog):
151
- """ Dialog to edit a label (name, color) """
152
- def __init__(self, parent, title, label, **kwargs):
153
- self.label = label
154
- dialog.Dialog.__init__(self, parent, title)
155
-
156
- def body(self, bodyFrame):
157
- bodyFrame.config(bg=Config.SCIPION_BG_COLOR)
158
- configureWeigths(bodyFrame, 1, 1)
159
-
160
- # Label
161
- label_text = tk.Label(bodyFrame, text="Name", bg=Config.SCIPION_BG_COLOR, bd=0)
162
- label_text.grid(row=0, column=0, sticky='nw', padx=(15, 10), pady=15)
163
- # Label box
164
- var = tk.StringVar()
165
- var.set(self.label.getName())
166
- self.textVar = var
167
- self.textLabel = tk.Entry(bodyFrame, width=20, font=getDefaultFont(), textvariable=var)
168
- self.textLabel.grid(row=0, column=1, sticky='news', padx=5, pady=5)
169
-
170
- # Comment
171
- colorLabel = tk.Label(bodyFrame, text='Color \n(Click to change)',
172
- bg=Config.SCIPION_BG_COLOR, bd=0)
173
- colorLabel.grid(row=1, column=0, sticky='nw', padx=(15, 10), pady=15)
174
- self.colorVar = tk.StringVar()
175
- self.colorVar.set(self.label.getColor())
176
- self.colorBox = tk.Frame(bodyFrame, bg=self.colorVar.get())
177
- self.colorBox.grid(row=1, column=1, sticky='news', padx=5, pady=5)
178
- colorLabel.bind('<Button-1>', self._changeColor)
179
- self.colorBox.bind('<Button-1>', self._changeColor)
180
-
181
- def apply(self):
182
- self.label.setName(self.textVar.get())
183
- self.label.setColor(self.colorVar.get())
184
-
185
- def _changeColor(self, e=None):
186
- hexColor = dialog.askColor(parent=self, defaultColor=self.colorVar.get())
187
- if hexColor is not None:
188
- self.colorBox.config(bg=hexColor)
189
- self.colorVar.set(hexColor)
190
-
191
- def validate(self):
192
-
193
- validationMsg = None
194
-
195
- if len(self.textVar.get().strip()) == 0:
196
- validationMsg = "Label name can't be empty.\n"
197
-
198
- if validationMsg is not None:
199
- dialog.showError("Validation error", validationMsg, self)
200
- return False
201
-
202
- return True
203
-
204
-
205
-