scipion-pyworkflow 3.7.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 (140) hide show
  1. pyworkflow/__init__.py +33 -0
  2. pyworkflow/apps/__init__.py +29 -0
  3. pyworkflow/apps/pw_manager.py +37 -0
  4. pyworkflow/apps/pw_plot.py +51 -0
  5. pyworkflow/apps/pw_project.py +113 -0
  6. pyworkflow/apps/pw_protocol_list.py +143 -0
  7. pyworkflow/apps/pw_protocol_run.py +51 -0
  8. pyworkflow/apps/pw_run_tests.py +267 -0
  9. pyworkflow/apps/pw_schedule_run.py +322 -0
  10. pyworkflow/apps/pw_sleep.py +37 -0
  11. pyworkflow/apps/pw_sync_data.py +439 -0
  12. pyworkflow/apps/pw_viewer.py +78 -0
  13. pyworkflow/config.py +536 -0
  14. pyworkflow/constants.py +212 -0
  15. pyworkflow/exceptions.py +18 -0
  16. pyworkflow/gui/__init__.py +36 -0
  17. pyworkflow/gui/browser.py +726 -0
  18. pyworkflow/gui/canvas.py +1190 -0
  19. pyworkflow/gui/dialog.py +976 -0
  20. pyworkflow/gui/form.py +2627 -0
  21. pyworkflow/gui/graph.py +247 -0
  22. pyworkflow/gui/graph_layout.py +271 -0
  23. pyworkflow/gui/gui.py +566 -0
  24. pyworkflow/gui/matplotlib_image.py +233 -0
  25. pyworkflow/gui/plotter.py +247 -0
  26. pyworkflow/gui/project/__init__.py +25 -0
  27. pyworkflow/gui/project/base.py +192 -0
  28. pyworkflow/gui/project/constants.py +139 -0
  29. pyworkflow/gui/project/labels.py +205 -0
  30. pyworkflow/gui/project/project.py +484 -0
  31. pyworkflow/gui/project/searchprotocol.py +154 -0
  32. pyworkflow/gui/project/searchrun.py +181 -0
  33. pyworkflow/gui/project/steps.py +166 -0
  34. pyworkflow/gui/project/utils.py +332 -0
  35. pyworkflow/gui/project/variables.py +179 -0
  36. pyworkflow/gui/project/viewdata.py +472 -0
  37. pyworkflow/gui/project/viewprojects.py +510 -0
  38. pyworkflow/gui/project/viewprotocols.py +2093 -0
  39. pyworkflow/gui/project/viewprotocols_extra.py +560 -0
  40. pyworkflow/gui/text.py +771 -0
  41. pyworkflow/gui/tooltip.py +185 -0
  42. pyworkflow/gui/tree.py +684 -0
  43. pyworkflow/gui/widgets.py +307 -0
  44. pyworkflow/mapper/__init__.py +26 -0
  45. pyworkflow/mapper/mapper.py +222 -0
  46. pyworkflow/mapper/sqlite.py +1578 -0
  47. pyworkflow/mapper/sqlite_db.py +145 -0
  48. pyworkflow/object.py +1512 -0
  49. pyworkflow/plugin.py +712 -0
  50. pyworkflow/project/__init__.py +31 -0
  51. pyworkflow/project/config.py +451 -0
  52. pyworkflow/project/manager.py +179 -0
  53. pyworkflow/project/project.py +1990 -0
  54. pyworkflow/project/scripts/clean_projects.py +77 -0
  55. pyworkflow/project/scripts/config.py +92 -0
  56. pyworkflow/project/scripts/create.py +77 -0
  57. pyworkflow/project/scripts/edit_workflow.py +90 -0
  58. pyworkflow/project/scripts/fix_links.py +39 -0
  59. pyworkflow/project/scripts/load.py +87 -0
  60. pyworkflow/project/scripts/refresh.py +83 -0
  61. pyworkflow/project/scripts/schedule.py +111 -0
  62. pyworkflow/project/scripts/stack2volume.py +41 -0
  63. pyworkflow/project/scripts/stop.py +81 -0
  64. pyworkflow/protocol/__init__.py +38 -0
  65. pyworkflow/protocol/bibtex.py +48 -0
  66. pyworkflow/protocol/constants.py +86 -0
  67. pyworkflow/protocol/executor.py +334 -0
  68. pyworkflow/protocol/hosts.py +313 -0
  69. pyworkflow/protocol/launch.py +270 -0
  70. pyworkflow/protocol/package.py +42 -0
  71. pyworkflow/protocol/params.py +744 -0
  72. pyworkflow/protocol/protocol.py +2554 -0
  73. pyworkflow/resources/Imagej.png +0 -0
  74. pyworkflow/resources/chimera.png +0 -0
  75. pyworkflow/resources/fa-exclamation-triangle_alert.png +0 -0
  76. pyworkflow/resources/fa-info-circle_alert.png +0 -0
  77. pyworkflow/resources/fa-search.png +0 -0
  78. pyworkflow/resources/fa-times-circle_alert.png +0 -0
  79. pyworkflow/resources/file_vol.png +0 -0
  80. pyworkflow/resources/loading.gif +0 -0
  81. pyworkflow/resources/no-image128.png +0 -0
  82. pyworkflow/resources/scipion_bn.png +0 -0
  83. pyworkflow/resources/scipion_icon.png +0 -0
  84. pyworkflow/resources/scipion_icon.svg +397 -0
  85. pyworkflow/resources/scipion_icon_proj.png +0 -0
  86. pyworkflow/resources/scipion_icon_projs.png +0 -0
  87. pyworkflow/resources/scipion_icon_prot.png +0 -0
  88. pyworkflow/resources/scipion_logo.png +0 -0
  89. pyworkflow/resources/scipion_logo_normal.png +0 -0
  90. pyworkflow/resources/scipion_logo_small.png +0 -0
  91. pyworkflow/resources/sprites.png +0 -0
  92. pyworkflow/resources/sprites.xcf +0 -0
  93. pyworkflow/resources/wait.gif +0 -0
  94. pyworkflow/template.py +322 -0
  95. pyworkflow/tests/__init__.py +29 -0
  96. pyworkflow/tests/test_utils.py +25 -0
  97. pyworkflow/tests/tests.py +341 -0
  98. pyworkflow/utils/__init__.py +38 -0
  99. pyworkflow/utils/dataset.py +414 -0
  100. pyworkflow/utils/echo.py +104 -0
  101. pyworkflow/utils/graph.py +196 -0
  102. pyworkflow/utils/log.py +284 -0
  103. pyworkflow/utils/path.py +527 -0
  104. pyworkflow/utils/process.py +132 -0
  105. pyworkflow/utils/profiler.py +92 -0
  106. pyworkflow/utils/progressbar.py +154 -0
  107. pyworkflow/utils/properties.py +627 -0
  108. pyworkflow/utils/reflection.py +129 -0
  109. pyworkflow/utils/utils.py +877 -0
  110. pyworkflow/utils/which.py +229 -0
  111. pyworkflow/viewer.py +328 -0
  112. pyworkflow/webservices/__init__.py +8 -0
  113. pyworkflow/webservices/config.py +11 -0
  114. pyworkflow/webservices/notifier.py +162 -0
  115. pyworkflow/webservices/repository.py +59 -0
  116. pyworkflow/webservices/workflowhub.py +74 -0
  117. pyworkflow/wizard.py +64 -0
  118. pyworkflowtests/__init__.py +51 -0
  119. pyworkflowtests/bibtex.py +51 -0
  120. pyworkflowtests/objects.py +830 -0
  121. pyworkflowtests/protocols.py +154 -0
  122. pyworkflowtests/tests/__init__.py +0 -0
  123. pyworkflowtests/tests/test_canvas.py +72 -0
  124. pyworkflowtests/tests/test_domain.py +45 -0
  125. pyworkflowtests/tests/test_logs.py +74 -0
  126. pyworkflowtests/tests/test_mappers.py +392 -0
  127. pyworkflowtests/tests/test_object.py +507 -0
  128. pyworkflowtests/tests/test_project.py +42 -0
  129. pyworkflowtests/tests/test_protocol_execution.py +72 -0
  130. pyworkflowtests/tests/test_protocol_export.py +78 -0
  131. pyworkflowtests/tests/test_protocol_output.py +158 -0
  132. pyworkflowtests/tests/test_streaming.py +47 -0
  133. pyworkflowtests/tests/test_utils.py +210 -0
  134. scipion_pyworkflow-3.7.0.dist-info/LICENSE.txt +674 -0
  135. scipion_pyworkflow-3.7.0.dist-info/METADATA +107 -0
  136. scipion_pyworkflow-3.7.0.dist-info/RECORD +140 -0
  137. scipion_pyworkflow-3.7.0.dist-info/WHEEL +5 -0
  138. scipion_pyworkflow-3.7.0.dist-info/dependency_links.txt +1 -0
  139. scipion_pyworkflow-3.7.0.dist-info/entry_points.txt +5 -0
  140. scipion_pyworkflow-3.7.0.dist-info/top_level.txt +2 -0
@@ -0,0 +1,627 @@
1
+ # -*- coding: utf-8 -*-
2
+ # **************************************************************************
3
+ # *
4
+ # * Authors: Jose Gutierrez (jose.gutierrez@cnb.csic.es)
5
+ # * Adrian Quintana (aquintana@cnb.csic.es)
6
+ # *
7
+ # * Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
8
+ # *
9
+ # * This program is free software; you can redistribute it and/or modify
10
+ # * it under the terms of the GNU General Public License as published by
11
+ # * the Free Software Foundation; either version 3 of the License, or
12
+ # * (at your option) any later version.
13
+ # *
14
+ # * This program is distributed in the hope that it will be useful,
15
+ # * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ # * GNU General Public License for more details.
18
+ # *
19
+ # * You should have received a copy of the GNU General Public License
20
+ # * along with this program; if not, write to the Free Software
21
+ # * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
22
+ # * 02111-1307 USA
23
+ # *
24
+ # * All comments concerning this program package may be sent to the
25
+ # * e-mail address 'scipion@cnb.csic.es'
26
+ # *
27
+ # **************************************************************************
28
+ """
29
+ This module defines the text used in the application.
30
+ """
31
+ # NOTE: DO NOT REMOVE UNTIL plugin manager uses Config.SCIPION_MAIN_COLOR and is released
32
+ from pyworkflow.constants import Color
33
+ from PIL import Image
34
+
35
+ class Message:
36
+ # Example Usage:
37
+ # MyMessage = Message()
38
+ # print MyMessage.label
39
+
40
+ # Header List
41
+ VIEW_PROJECTS = 'Projects'
42
+ VIEW_PROTOCOLS = 'Protocols'
43
+ VIEW_DATA = 'Data'
44
+ VIEW_UPLOAD = 'Upload'
45
+
46
+ # Projects Template
47
+ LABEL_PROJECTS = 'Projects'
48
+ LABEL_CREATE_PROJECT = 'Create Project'
49
+ LABEL_IMPORT_PROJECT = 'Import project'
50
+ TITLE_CREATE_PROJECT = 'Enter the project name'
51
+ TITLE_CREATE_PROJECT_NAME = 'Project Name: '
52
+ TITLE_EDIT_OBJECT = 'Edit Object properties'
53
+ MESSAGE_DELETE_PROJECT = 'This will *delete* the project and all its *data*. Are you sure?'
54
+ LABEL_DELETE_PROJECT = '[Delete]'
55
+ TITLE_DELETE_PROJECT = 'Confirm project deletion'
56
+ LABEL_RENAME_PROJECT = '[Rename]'
57
+ TITLE_RENAME_PROJECT = 'Confirm project renaming'
58
+ LABEL_CREATED = 'Created: '
59
+ LABEL_MODIFIED = 'Modified: '
60
+
61
+ # Project Content Template
62
+ LABEL_PROJECT = 'Project '
63
+
64
+ # -- Protocol Treeview --
65
+ LABEL_WORKFLOW = 'Workflow View: '
66
+ LABEL_PROTTREE_NONE = 'None'
67
+
68
+ # -- Toolbar --
69
+ LABEL_NEW = 'Add'
70
+ LABEL_EDIT = 'Edit'
71
+ LABEL_RENAME = 'Rename '
72
+ LABEL_COPY = 'Copy'
73
+ LABEL_PASTE = 'Paste'
74
+ LABEL_DUPLICATE = 'Duplicate'
75
+ LABEL_DELETE = 'Delete'
76
+ LABEL_STEPS = 'Steps'
77
+ LABEL_BROWSE = 'Browse'
78
+ LABEL_DB = 'Db'
79
+ LABEL_STOP = 'Stop'
80
+ LABEL_ANALYZE = 'Analyze results'
81
+ LABEL_TREE = 'Tree'
82
+ LABEL_SMALLTREE = 'Small Tree'
83
+ LABEL_REFRESH = 'Refresh'
84
+ LABEL_DEFAULT = 'Default'
85
+ LABEL_CONTINUE = 'Continue'
86
+ LABEL_EXPORT = 'Export'
87
+ LABEL_EXPORT_UPLOAD = 'Export & upload'
88
+ LABEL_RESTART_WORKFLOW = 'Restart all'
89
+ LABEL_CONTINUE_WORKFLOW = 'Continue all'
90
+ LABEL_STOP_WORKFLOW = 'Stop from'
91
+ LABEL_RESET_WORKFLOW = 'Reset from'
92
+
93
+ # -- Tabs --
94
+ LABEL_DATA = 'Data'
95
+ LABEL_SUMMARY = 'Summary'
96
+ LABEL_INPUT = 'Input'
97
+ LABEL_OUTPUT = 'Output'
98
+ LABEL_COMMENT = 'Comments'
99
+
100
+ LABEL_OBJSUMMARY = 'Object Summary'
101
+ LABEL_OBJINFO = 'Info'
102
+ LABEL_OBJCREATED = 'Created'
103
+ LABEL_OBJLABEL = 'Label'
104
+
105
+ LABEL_METHODS = 'Methods'
106
+ LABEL_BIB_BTN = 'Export references'
107
+ LABEL_LOGS = 'Output Logs'
108
+ LABEL_LOGS_OUTPUT = 'Output Log'
109
+ LABEL_LOGS_ERROR = 'Error Log'
110
+ LABEL_LOGS_SCIPION = 'Project Log'
111
+
112
+ NO_INFO_SUMMARY = 'No summary information.'
113
+ NO_INFO_METHODS = 'No methods information.'
114
+ NO_INFO_LOGS = 'No logs information.'
115
+ NO_SAVE_SETTINGS = 'Error trying to save settings.'
116
+
117
+ # ------- Protocol Form messages ----------
118
+ LABEL_CITE = 'Cite'
119
+ LABEL_HELP = 'Help'
120
+ TEXT_HELP = 'The file selected will be uploaded to the project folder. If the file was uploaded before, it will be replaced.'
121
+ LABEL_RUNNAME = 'Run name'
122
+ LABEL_EXECUTION = 'Run mode'
123
+ LABEL_RUNMODE = 'Mode'
124
+ LABEL_PARALLEL = 'Parallel'
125
+ LABEL_HOST = 'Host'
126
+ LABEL_THREADS = 'Threads'
127
+ LABEL_MPI = 'MPI'
128
+ LABEL_QUEUE = 'Use a queue engine?'
129
+
130
+ LABEL_WAIT_FOR = 'Wait for'
131
+
132
+ LABEL_EXPERT = 'Expert Level'
133
+ LABEL_EXPERT_NORMAL = 'Normal'
134
+ LABEL_EXPERT_ADVANCE = 'Advanced'
135
+ LABEL_EXPERT_EXPERT = 'Expert'
136
+
137
+ HELP_RUNMODE = """
138
+ Normally, each protocol is composed of several atomic steps.
139
+ Each step could be computationally intensive, that's why
140
+ the *Continue* execution mode will try to continue from the
141
+ last completed step. On the other hand, the *Restart* mode
142
+ will clean the whole run directory and start from scratch.
143
+ """
144
+
145
+ HELP_MPI_THREADS = """
146
+ Define the number of processors to be used in the execution.
147
+ *MPI*: This is a number of independent processes
148
+ that communicate through message passing
149
+ over the network (or the same computer).
150
+ *Threads*: This refers to different execution threads
151
+ in the same process that can share memory. They run in
152
+ the same computer.
153
+ """
154
+
155
+ HELP_USEQUEUE = """
156
+ Click Yes if you want to send this execution to a queue engine like Slurm, Torque, ...
157
+ The queue commands to launch and stop jobs should be configured at
158
+ _%s_ file.
159
+
160
+ See %s for more information.
161
+ """
162
+ HELP_USEQUEUEPERJOB = """
163
+ Click *Yes* if you want to submit the multiple jobs per protocol to a Queue system.
164
+ The queue commands for launch and stop jobs should be configured
165
+ for the current host in the _hosts.conf_ file.
166
+ """
167
+
168
+ HELP_WAIT_FOR = """
169
+ Specify a comma separated list of protocol IDs if you want
170
+ to *schedule* this protocol and wait for those protocols to finish before
171
+ starting this one.
172
+
173
+ This function will allow you to "schedule" many
174
+ runs that will be executed after each other.
175
+
176
+ See %s for more information.
177
+ """
178
+
179
+ TITLE_NAME_RUN = ' Protocol Run: '
180
+ TITLE_RUN = 'Run'
181
+ TITLE_LABEL = 'Label'
182
+ LABEL_OPT_COMMENT = 'Describe your run here...'
183
+ TITLE_COMMENT = 'Comment'
184
+ LABEL_RUN_MODE_RESUME = 'resume'
185
+ LABEL_RUN_MODE_RESTART = 'restart'
186
+ TITLE_EXEC = 'Execution'
187
+ TITLE_BROWSE_DATA = 'Protocol data'
188
+ LABEL_QUEUE_YES = 'Yes'
189
+ LABEL_QUEUE_NO = 'No'
190
+ LABEL_PARAM_YES = 'Yes'
191
+ LABEL_PARAM_NO = 'No'
192
+ LABEL_BUTTON_CLOSE = 'Close'
193
+ LABEL_BUTTON_SAVE = 'Save'
194
+ LABEL_BUTTON_EXEC = 'Execute'
195
+ LABEL_BUTTON_VIS = 'Visualize'
196
+ LABEL_BUTTON_WIZ = 'Wizard'
197
+ LABEL_BUTTON_HELP = 'Help'
198
+ LABEL_BUTTON_RETURN = 'Save'
199
+ # VARS
200
+ VAR_EXEC_HOST = 'hostName'
201
+ VAR_EXPERT = 'expertLevel'
202
+ VAR_MPI = 'numberOfMpi'
203
+ VAR_QUEUE = '_useQueue'
204
+ VAR_RUN_NAME = 'runName'
205
+ VAR_COMMENT = 'comment'
206
+ VAR_RUN_MODE = 'runMode'
207
+ VAR_THREADS = 'numberOfThreads'
208
+
209
+ LABEL_PATTERN = 'Pattern'
210
+ TEXT_PATTERN = """\
211
+ Pattern (that can include wildcards) of the files to import.
212
+ For example:
213
+ *data/particles/***.spi*
214
+ *~/Micrographs/mic/***.mrc*"""
215
+ ERROR_PATTERN_EMPTY = 'The *pattern* cannot be empty.'
216
+ ERROR_PATTERN_FILES = 'There are no files matching the *pattern*'
217
+ LABEL_CHECKSTACK = 'Check stack files?'
218
+ LABEL_COPYFILES = 'Copy files?'
219
+ LABEL_VOLTAGE = 'Microscope voltage (kV)'
220
+ TEXT_VOLTAGE = "Microscope voltage"
221
+ LABEL_SPH_ABERRATION = 'Spherical aberration (mm)'
222
+ TEXT_SPH_ABERRATION = """\
223
+ Optical effect due to the increased refraction of light rays when they
224
+ strike the lens near its edge, in comparison with those that strike near
225
+ the center."""
226
+ LABEL_AMPLITUDE = 'Amplitude Contrast'
227
+ TEXT_AMPLITUDE = """\
228
+ Produced by the loss of amplitude (i.e. electrons) from the beam.
229
+
230
+ For a weak phase and weak amplitude object, the amplitude contrast ratio Qo
231
+ is automatically computed. It should be a positive number, typically between
232
+ 0.05 and 0.3."""
233
+ LABEL_PATTERNU = 'Pattern untilted'
234
+ LABEL_PATTERNT = 'Pattern tilted'
235
+
236
+ LABEL_SAMP_MODE = 'Sampling rate mode'
237
+ TEXT_SAMP_MODE = """\
238
+ You can specify the sampling rate (pixel size) directly from the image
239
+ (A/pixel, Ts) or by specifying the magnification rate (M) and the scanner
240
+ pixel size (microns/pixel, Tm).
241
+
242
+ They are related by Ts = Tm / M"""
243
+ LABEL_SAMP_MODE_1 = 'From image'
244
+ LABEL_SAMP_MODE_2 = 'From scanner'
245
+ LABEL_SAMP_RATE = 'Pixel size (sampling rate) Å/px'
246
+ TEXT_SAMP_RATE = "Pixel size"
247
+ LABEL_MAGNI_RATE = 'Magnification rate'
248
+ TEXT_MAGNI_RATE = """\
249
+ Electron optical magnification (M). It can be used to compute the Image Pixel
250
+ Size ("Sampling Rate") (Ts) using the Scanner Pixel Size (Tm), Ts = Tm / M."""
251
+ LABEL_SCANNED = 'Scanned pixel size (microns/px)'
252
+
253
+ ERROR_IMPORT_VOL = 'importVolumes: There are no filePaths matching the pattern'
254
+
255
+ LABEL_CTF_ESTI = 'CTF Estimation'
256
+ LABEL_INPUT_MIC = 'Input Micrographs'
257
+ LABEL_INPUT_PART = 'Input Particles'
258
+ LABEL_INPUT_VOLS = 'Input Volumes'
259
+ LABEL_INPUT_MOVS = 'Input Movies'
260
+ LABEL_ALIG_PART = 'Write aligned particles?'
261
+ TEXT_ALIG_PART = 'If set to *Yes*, the alignment will be applied to \n'+'input particles and a new aligned set will be created.'
262
+
263
+ TEXT_NO_INPUT_MIC = 'No *Input Micrographs* selected.'
264
+ TEXT_NO_CTF_READY = 'CTF of *Input Micrographs* not ready yet.'
265
+ TEXT_NO_OUTPUT_CO = 'Output coordinates not ready yet.'
266
+ ERROR_NO_EST_CTF = '_estimateCTF should be implemented'
267
+ TEXT_NO_OUTPUT_FILES = 'No output file produced'
268
+
269
+ TITLE_LAUNCHED = 'Success'
270
+ LABEL_LAUNCHED = 'The protocol was launched successfully.'
271
+ LABEL_FOUND_ERROR = 'Errors found'
272
+ TITLE_SAVED_FORM = 'Success'
273
+ LABEL_SAVED_FORM = 'The protocol was saved successfully.'
274
+ TITLE_DELETE_FORM = 'Confirm DELETE'
275
+ TITLE_RESTART_FORM = 'Confirm RESTART'
276
+ TITLE_CONTINUE_FORM = 'Confirm CONTINUE'
277
+ LABEL_DELETE_FORM = """
278
+ You are going to *DELETE* the run(s):
279
+ - %s
280
+ *ALL DATA* related will be permanently removed.
281
+
282
+ Do you really want to continue?'
283
+ """
284
+ MESSAGE_RESTART_FORM = """
285
+ You are going to *RESTART* the run:
286
+ %s
287
+
288
+ Do you really want to restart it?
289
+ """
290
+ MESSAGE_CONTINUE_FORM = """
291
+ You are going to *CONTINUE* the run:
292
+ %s
293
+
294
+ Do you really want to continue it?
295
+ """
296
+
297
+ MESSAGE_RESTART_WORKFLOW_WITH_RESULTS = """
298
+ All previous results of the following protocols will be deleted:
299
+ %s
300
+
301
+ Do you really want to *RESTART* the workflow?'
302
+ """
303
+
304
+ MESSAGE_CONTINUE_WORKFLOW_WITH_RESULTS = """
305
+ All previous results of the following protocols will be affected:
306
+ %s
307
+
308
+ Do you really want to *CONTINUE* the workflow?
309
+ """
310
+
311
+ MESSAGE_ASK_SINGLE_ALL = """
312
+ What do you want to do?
313
+
314
+ *Single* : Just this protocol.
315
+ *All*: All above listed protocols will be launched.
316
+ """
317
+
318
+
319
+ TITLE_STOP_FORM = 'Confirm STOP'
320
+ LABEL_STOP_FORM = 'Do you really want to *STOP* this run?'
321
+
322
+ NO_VIEWER_FOUND = 'There is no viewer for protocol:'
323
+
324
+ TITLE_SAVE_OUTPUT = 'Save protocol output'
325
+ LABEL_SAVE_OUTPUT = 'Do you wish to save protocol output?'
326
+
327
+ TITLE_RESTART_WORKFLOW_FORM = 'Confirm RESTART workflow'
328
+ TITLE_CONTINUE_WORKFLOW_FORM = 'Confirm CONTINUE workflow'
329
+ TITLE_STOP_WORKFLOW_FORM = 'Confirm STOP'
330
+ TITLE_RESET_WORKFLOW_FORM = 'Confirm RESET'
331
+ MESSAGE_RESTART_WORKFLOW = 'Do you really want to *RESTART* this workflow?'
332
+ MESSAGE_CONTINUE_WORKFLOW = 'Do you really want to *CONTINUE* this workflow?'
333
+ TITLE_STOP_WORKFLOW = 'Do you really want to *STOP* this Workflow?'
334
+ TITLE_RESET_WORKFLOW = 'Do you really want to *RESET* this Workflow?'
335
+ TITLE_LAUNCHED_WORKFLOW_FAILED_FORM = 'Error while launching the workflow'
336
+ TITLE_STOPPED_WORKFLOW_FAILED = 'Error while stopping the workflow'
337
+ TITLE_RESETED_WORKFLOW_FAILED = 'Error while resetting the workflow'
338
+ TITLE_LAUNCHED_WORKFLOW_FAILED = 'The workflow can not be relaunched from this protocol.\n'
339
+ TITLE_ACTIVE_PROTOCOLS = 'The following protocols are active:'
340
+
341
+ # SHOWJ_WEB
342
+ SHOWJ_TITLE = 'Showj'
343
+
344
+ LABEL_RESLICE = 'Reslice'
345
+ RESLICE_Z_NEGATIVE = 'Z Negative (Front)'
346
+ RESLICE_Y_NEGATIVE = 'Y Negative (Top)'
347
+ RESLICE_Y_POSITIVE = 'Y Positive (Bottom)'
348
+ RESLICE_X_NEGATIVE = 'X Negative (Left)'
349
+ RESLICE_X_POSITIVE = 'X Positive (Right)'
350
+
351
+ LABEL_COLS = 'Cols'
352
+ LABEL_ROWS = 'Rows'
353
+
354
+ LABEL_MIRRORY = 'Invert Y Axis'
355
+ LABEL_APPLY_TRANSFORM = 'Apply Transform Matrix'
356
+ LABEL_ONLY_SHIFTS = 'Only Shifts'
357
+ LABEL_WRAP = 'Wrap'
358
+
359
+ LABEL_BLOCK_SELECTION = 'Select Block'
360
+ LABEL_LABEL_SELECTION = 'Select Label'
361
+ LABEL_VOLUME_SELECTION = 'Select Volume'
362
+
363
+ LABEL_ENABLE = 'Enable'
364
+ LABEL_DISABLE = 'Disable'
365
+ LABEL_SELECT_ALL = 'Select all'
366
+ LABEL_SELECT_FROM = 'Select from'
367
+ LABEL_SELECT_TO = 'Select to'
368
+
369
+ LABEL_DISPLAY_TABLE_CONFIG = 'Display Table Configuration'
370
+
371
+ LABEL_LABEL = 'Label'
372
+ LABEL_VISIBLE = 'Visible'
373
+ LABEL_RENDER = 'Render'
374
+
375
+ LABEL_BUTTON_OK = 'Ok'
376
+ LABEL_BUTTON_CANCEL = 'Cancel'
377
+
378
+ LABEL_THRESHOLD = 'Threshold:'
379
+
380
+ ERROR_DIMENSIONS = 'Incorrect table width or height: '
381
+ ERROR_WEBGL = 'Your web browser does not support or is not configured for WebGL. See [[http://get.webgl.org/][WebGL Support]] for more information.'
382
+
383
+ TOOLTIP_SEARCH = 'Search for a given world in the text. '
384
+ TOOLTIP_SEARCH_NEXT = 'Move to the next highlighted item. Also, press <Down> or <F3>'
385
+ TOOLTIP_SEARCH_PREVIOUS = 'Move to the previous highlighted item. Also, press <Up> or <Shift-F3>'
386
+ TOOLTIP_REFRESH = 'Reload the content of the files in the viewer. '
387
+ TOOLTIP_EXTERNAL = 'Open the viewer in an external window. '
388
+
389
+ TITLE_PICK_GAUSS = 'Automatic gaussian picking'
390
+ LABEL_PICK_GAUSS = 'Do you wish to perform an automatic gaussian picking for the remaining micrographs?'
391
+
392
+ TITLE_INSPECTOR = 'Objects inspector'
393
+ LABEL_INSPECTOR = 'Objects inspector will inspect the whole project. ' \
394
+ 'Thus, it can take a while depending on the size of the project.\n' \
395
+ 'Do you want to continue?'
396
+ EXECUTE_PLUGINS_MANAGER_OPERATION = 'Execute all selected operations'
397
+ CANCEL_SELECTED_OPERATION = 'Cancel a selected operation'
398
+
399
+
400
+ # PLUGIN/BINARY STATES
401
+ class PluginStates:
402
+ PLUGIN = 'plugin'
403
+ BINARY = 'binary'
404
+ UNCHECKED = 'unchecked'
405
+ CHECKED = 'checked'
406
+ INSTALL = 'install'
407
+ UNINSTALL = 'uninstall'
408
+ TO_INSTALL = 'to_install'
409
+ INSTALLED = 'installed'
410
+ PRECESSING = 'processing'
411
+ FAILURE = 'failure'
412
+ AVAILABLE_RELEASE = 'available_release'
413
+ TO_UPDATE = 'to_update'
414
+ SUCCESS = 'success'
415
+ ERRORS = 'errors'
416
+ WAITING = 'waiting'
417
+
418
+
419
+ class PluginInformation:
420
+ PLUGIN_URL = 'pluginURL'
421
+ PLUGIN_NAME = 'pluginName'
422
+ PLUGIN_VERSION = 'pluginVersion'
423
+ PLUGIN_RELEASE_DATE = 'pluginUploadedDate'
424
+ PLUGIN_DESCRIPTION = 'pluginDescription'
425
+ PLUGIN_AUTHORS = 'pluginAuthor'
426
+
427
+ class SpriteImage:
428
+ def __init__(self, top, left, name, bottom=None, right=None):
429
+ self.top = top
430
+ self.left = left
431
+ self.bottom = bottom if bottom else top+16
432
+ self.right = right if right else left+16
433
+ self.name = name
434
+ def __str__(self):
435
+ return self.name
436
+ def __len__(self):
437
+ return len(self.name)
438
+
439
+ class Sprite:
440
+ _image=None
441
+ # Default width of the sprite to calculate the ratio. For other sprites make sprite file n times bigger
442
+ DEFAULT_WIDTH = 320
443
+ RATIO = None
444
+ "Ratio of the sprite file of the SpriteImage definitions"
445
+
446
+ @classmethod
447
+ def getSpritesFile(cls):
448
+ from pyworkflow import Config
449
+ return Config.SCIPION_SPRITES_FILE
450
+ @classmethod
451
+ def loadSprites(cls):
452
+ """ Loads the image of the sprite"""
453
+ if not cls._image:
454
+ cls._image = Image.open(cls.getSpritesFile())
455
+
456
+ from pyworkflow import Config
457
+ # If any zoom to apply
458
+ if Config.SCIPION_ICON_ZOOM != 100:
459
+ factor = Config.SCIPION_ICON_ZOOM/100
460
+ size = cls._image.size
461
+ newSize=size[0] * factor, size[1]* factor
462
+ cls.image = cls._image.thumbnail(newSize)
463
+ width = cls._image.width
464
+ cls.RATIO = width/cls.DEFAULT_WIDTH
465
+ return cls._image
466
+
467
+ @classmethod
468
+ def getImage(cls, sprite:SpriteImage):
469
+ """ Returns the image cut put from the stripe file at the locations define by SpriteImage"""
470
+ sprites = cls.loadSprites()
471
+ return sprites.crop((sprite.left*cls.RATIO, sprite.top*cls.RATIO, sprite.right*cls.RATIO, sprite.bottom*cls.RATIO))
472
+
473
+
474
+ # To get font awesome icons into png use: http://fa2png.io/
475
+ class Icon:
476
+ # Protocols status
477
+ PROT_DISABLED = SpriteImage(16,32,'prot_disabled.png',bottom=32,right=64)
478
+ BETA = SpriteImage(0,0,'beta.png',bottom=16,right=32)
479
+ NEW = SpriteImage(32,0,'new.png',bottom=48,right=32)
480
+ PRODUCTION = SpriteImage(32,32,'production.png',bottom=48,right=64)
481
+ UPDATED = SpriteImage(16,0,'updated.png',bottom=32,right=32)
482
+
483
+ GROUP = SpriteImage(80, 224,'class_obj.png')
484
+ FAVORITE = SpriteImage(80,256,'bookmark.png')
485
+ DEBUG = SpriteImage(64,288,'debug.png')
486
+ DOWNLOAD = SpriteImage(48,272,'fa-download.png')
487
+ FIND = SpriteImage(80,272,'binoculares.png')
488
+ SELECT_ALL = SpriteImage(0,32,'workflow.png')
489
+
490
+ # Project window icons
491
+ RUNS_TREE = SpriteImage(16,272,'fa-sitemap.png')
492
+ ACTION_NEW = SpriteImage(80,304,'fa-plus-circle.png')
493
+ ACTION_EDIT = SpriteImage(32,272,'fa-pencil.png')
494
+ ACTION_SELECT_FROM = SpriteImage(64,272,'fa-arrow-down.png')
495
+ ACTION_SELECT_TO = SpriteImage(64,256,'fa-arrow-up.png')
496
+ ACTION_COPY = SpriteImage(80,208,'clipboard-regular.png')
497
+ ACTION_PASTE = SpriteImage(0,64,'paste-solid.png')
498
+ ACTION_DUPLICATE = SpriteImage(48,208,'fa-files-o.png')
499
+ ACTION_DELETE = SpriteImage(16,176,'fa-trash-o.png')
500
+ ACTION_REFRESH = SpriteImage(32,144, 'fa-refresh.png')
501
+ ACTION_RENAME = SpriteImage(0,48,'rename.png')
502
+ ACTION_BROWSE = SpriteImage(32,304,'fa-folder-open.png')
503
+ ACTION_DB = SpriteImage(48,288,'fa-database.png')
504
+ ACTION_STOP = SpriteImage(16,256,'fa-stop.png')
505
+ ACTION_CONTINUE = SpriteImage(32,256,'fa-play-circle-o.png')
506
+ ACTION_STOP_WORKFLOW = SpriteImage(16,240,'fa-stop-workflow.png')
507
+ ACTION_RESULTS = SpriteImage(48,240,'fa-eye.png')
508
+ ACTION_SAVE = SpriteImage(32,112, 'fa-save.png')
509
+ ACTION_VISUALIZE = ACTION_RESULTS
510
+ ACTION_WIZ = SpriteImage(32,288,'fa-magic.png')
511
+ ACTION_HELP = SpriteImage(32,160,'fa-question-circle.png')
512
+ ACTION_REFERENCES = SpriteImage(48,256,'link')
513
+ ACTION_EXPORT = ACTION_REFERENCES
514
+ ACTION_EXPORT_UPLOAD = SpriteImage(16,96, 'fa-upload.png')
515
+ ACTION_SEARCH = SpriteImage(32,96, 'fa-search.png')
516
+ SETTINGS = SpriteImage(48,304,'fa-cogs.png')
517
+ ACTION_EXECUTE = SETTINGS
518
+ ACTION_IN = SpriteImage(16,304,'fa-sign-in.png')
519
+ ACTION_OUT = SpriteImage(16,288,'fa-sign-out.png')
520
+ ACTION_FIND_NEXT = SpriteImage(32,208,'fa-next.png')
521
+ ACTION_FIND_PREVIOUS = SpriteImage(32,192,'fa-previous.png')
522
+ ACTION_COLLAPSE = SpriteImage(32,240,'fa-minus-square.png')
523
+ ACTION_EXPAND = SpriteImage(32,224,'fa-plus-square.png')
524
+ ACTION_CIRCLE = SpriteImage(48,192,'circle.png')
525
+ ACTION_PICKING = SpriteImage(64, 192, 'picking.png')
526
+ ACTION_STATS = SpriteImage(80, 192, 'stats.png')
527
+ ACTION_ZOOM = SpriteImage(64, 176, 'zoom.png')
528
+ ACTION_HAND = SpriteImage(80, 176, 'hand.png')
529
+ ACTION_FILAMENT_PICKING = SpriteImage(48, 176, 'filament.png')
530
+ ACTION_GRID = SpriteImage(64, 160, 'grid.png')
531
+ ACTION_CONTRAST = SpriteImage(80, 160, 'contrast.png')
532
+
533
+
534
+ # Host template
535
+ BUTTON_SELECT = SpriteImage(64,224,'fa-check.png')
536
+ BUTTON_CANCEL = SpriteImage(64,240,'fa-ban.png')
537
+ ACTION_CLOSE = BUTTON_CANCEL
538
+ BUTTON_CLOSE = ACTION_CLOSE
539
+ BUTTON_SAVE = ACTION_SAVE
540
+
541
+ ARROW_UP = ACTION_SELECT_TO
542
+ TAGS = SpriteImage(16,224,'fa-tags.png')
543
+ HOME = SpriteImage(0,304,'fa-home.png')
544
+ LIGHTBULB = SpriteImage(32,80,'fa-lightbulb-o.png')
545
+ ROCKET = SpriteImage(32,128, 'fa-rocket.png')
546
+
547
+ # File browser icons
548
+ FOLDER_OPEN = ACTION_BROWSE
549
+ DB = SpriteImage(0,144,'file_sqlite.png')
550
+ TXT_FILE = SpriteImage(0,96,'file_text.png')
551
+ FILE_VOL = SpriteImage(0,80,'file_vol.png')
552
+ FILE_STACK = SpriteImage(0,112,'file_stack.png')
553
+ FILE_STACK_LINK = SpriteImage(0,128, 'file_stack_link.png')
554
+ PYTHON_FILE = SpriteImage(0,160,'file_python.png')
555
+ FILE_METADATA = SpriteImage(0,176,'file_md.png')
556
+ FILE_METADATA_LINK = SpriteImage(0,192, 'file_md_link.png')
557
+ FILE_IMAGE = SpriteImage(0,208, 'file_image.png')
558
+ FILE_IMAGE_LINK = SpriteImage(0,224, 'file_image_link.png')
559
+ FILE = SpriteImage(0,240, 'file_generic.png')
560
+ FILE_LINK = SpriteImage(0,256, 'file_generic_link.png')
561
+ FOLDER = SpriteImage(0,272, 'file_folder.png')
562
+ FOLDER_LINK = SpriteImage(0,288, 'file_folder_link.png')
563
+
564
+ BROOM = SpriteImage(80,240,'broom-solid.png')
565
+ BACKWARD = SpriteImage(80,288,'backward-solid.png')
566
+ CODE_BRANCH = SpriteImage(64,304,'code-branch-solid.png')
567
+
568
+ # Dialog icons
569
+ ERROR = 'fa-times-circle_alert.png'
570
+ INFO = 'fa-info-circle_alert.png'
571
+ ALERT = 'fa-exclamation-triangle_alert.png'
572
+ NO_IMAGE_128 = 'no-image128.png'
573
+
574
+ SCIPION_ICON = 'scipion_icon.png'
575
+ SCIPION_ICON_PROJ = 'scipion_icon_proj.png'
576
+ SCIPION_ICON_PROJS = 'scipion_icon_projs.png'
577
+ SCIPION_ICON_PROT = 'scipion_icon_prot.png'
578
+ SCIPION_LOGO_SMALL = 'scipion_logo_small.png'
579
+
580
+ # EXTERNAL PROGRAMS
581
+ CHIMERA = 'chimera.png'
582
+
583
+ # PLUGIN MANAGER ICONS
584
+ CHECKED = SpriteImage(64,208,'fa-checked.png')
585
+ UNCHECKED = SpriteImage(16,160,'fa-unchecked.png')
586
+ INSTALL = SpriteImage(32,64,'fa-install.png')
587
+ UNINSTALL = ACTION_CLOSE
588
+ TO_INSTALL = SpriteImage(32,256,'fa-to_install.png')
589
+ INSTALLED = SpriteImage(16, 64,'fa-installed.png')
590
+ PROCESSING = SpriteImage(32, 176, 'fa-processing.png',48,192)
591
+ FAILURE = SpriteImage(48,224,'fa-failure.png')
592
+ DELETE_OPERATION = ACTION_DELETE
593
+ TO_UPDATE = SpriteImage(32,144,'fa-update.png')
594
+ WAITING = 'wait.gif'
595
+ ACTION_UNDO = SpriteImage(16,144,'fa-undo.png')
596
+
597
+ PLUGIN_AUTHORS = SpriteImage(16,80,'users.png')
598
+ PLUGIN_DESCRIPTION = FILE_STACK
599
+ PLUGIN_RELEASE_DATE = ACTION_EXPORT_UPLOAD
600
+ PLUGIN_VERSION = FILE_VOL
601
+ PLUGIN_PACKAGE = FOLDER
602
+
603
+
604
+ class colorText:
605
+ """printing in colors, bold, etc,
606
+ example: print colorText.BOLD + 'Hello World !' + color.END
607
+ """
608
+ PURPLE = '\033[95m'
609
+ CYAN = '\033[96m'
610
+ DARKCYAN = '\033[36m'
611
+ BLUE = '\033[94m'
612
+ GREEN = '\033[92m'
613
+ YELLOW = '\033[93m'
614
+ RED = '\033[91m'
615
+ BOLD = '\033[1m'
616
+ UNDERLINE = '\033[4m'
617
+ END = '\033[0m'
618
+
619
+
620
+ class KEYSYM:
621
+ """ Keysym values for evaluating key pressed within events
622
+ as reported at http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/key-names.html
623
+ """
624
+ DELETE = 'Delete'
625
+ RETURN = 'Return'
626
+ SHIFT = 'Shift'
627
+ CONTROL = 'Control'