processview 0.1.3__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview/__pycache__/version.cpython-37.pyc +0 -0
- home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview/core/manager/__pycache__/manager.cpython-37.pyc +0 -0
- home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview/core/manager/manager.py +13 -0
- home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview/gui/__pycache__/messagebox.cpython-37.pyc +0 -0
- home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview/gui/__pycache__/processmanager.cpython-37.pyc +0 -0
- home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview/gui/messagebox.py +59 -0
- home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview/gui/processmanager.py +17 -7
- home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview/version.py +3 -3
- home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/{processview-0.1.3-py3.7.egg-info → processview-0.2.1-py3.7.egg-info}/PKG-INFO +1 -1
- home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/{processview-0.1.3-py3.7.egg-info → processview-0.2.1-py3.7.egg-info}/SOURCES.txt +1 -0
- /home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/{processview-0.1.3-py3.7.egg-info → processview-0.2.1-py3.7.egg-info}/dependency_links.txt +0 -0
- /home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/{processview-0.1.3-py3.7.egg-info → processview-0.2.1-py3.7.egg-info}/not-zip-safe +0 -0
- /home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/{processview-0.1.3-py3.7.egg-info → processview-0.2.1-py3.7.egg-info}/requires.txt +0 -0
- /home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/{processview-0.1.3-py3.7.egg-info → processview-0.2.1-py3.7.egg-info}/top_level.txt +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -50,6 +50,7 @@ class DatasetState(_Enum):
|
|
|
50
50
|
FAILED = "failed"
|
|
51
51
|
PENDING = "pending"
|
|
52
52
|
SKIPPED = "skipped"
|
|
53
|
+
WAIT_USER_VALIDATION = "waiting user validation"
|
|
53
54
|
|
|
54
55
|
|
|
55
56
|
@singleton
|
|
@@ -68,6 +69,8 @@ class ProcessManager:
|
|
|
68
69
|
"""list of callback to trigger when an update is generated"""
|
|
69
70
|
self._newProcessCallback = set()
|
|
70
71
|
"""list of callback to trigger when a process is added"""
|
|
72
|
+
self._processRemovedCallback = set()
|
|
73
|
+
"""list of callback to trigger when a process is removed"""
|
|
71
74
|
self.lock = threading.Lock()
|
|
72
75
|
|
|
73
76
|
def met(self, process, dataset) -> bool:
|
|
@@ -131,6 +134,9 @@ class ProcessManager:
|
|
|
131
134
|
if process.process_id in self._processes and process.is_master_process:
|
|
132
135
|
del self._processes[process.process_id]
|
|
133
136
|
|
|
137
|
+
for callback in self._processRemovedCallback:
|
|
138
|
+
callback()
|
|
139
|
+
|
|
134
140
|
def get_processes(self) -> tuple:
|
|
135
141
|
"""
|
|
136
142
|
|
|
@@ -312,6 +318,13 @@ class ProcessManager:
|
|
|
312
318
|
if callback in self._newProcessCallback:
|
|
313
319
|
self._newProcessCallback.remove(callback)
|
|
314
320
|
|
|
321
|
+
def add_process_removed_callback(self, callback):
|
|
322
|
+
self._processRemovedCallback.add(callback)
|
|
323
|
+
|
|
324
|
+
def remove_process_removed_callback(self, callback):
|
|
325
|
+
if callback in self._processRemovedCallback:
|
|
326
|
+
self._processRemovedCallback.remove(callback)
|
|
327
|
+
|
|
315
328
|
def clear(self):
|
|
316
329
|
"""
|
|
317
330
|
clear registered processes and dataset states
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
# /*##########################################################################
|
|
3
|
+
#
|
|
4
|
+
# Copyright (c) 2016-2017 European Synchrotron Radiation Facility
|
|
5
|
+
#
|
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
# furnished to do so, subject to the following conditions:
|
|
12
|
+
#
|
|
13
|
+
# The above copyright notice and this permission notice shall be included in
|
|
14
|
+
# all copies or substantial portions of the Software.
|
|
15
|
+
#
|
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
22
|
+
# THE SOFTWARE.
|
|
23
|
+
#
|
|
24
|
+
# ###########################################################################*/
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
__authors__ = ["H. Payno"]
|
|
28
|
+
__license__ = "MIT"
|
|
29
|
+
__date__ = "29/03/2021"
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
from silx.gui import qt
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class MessageBox(qt.QDialog):
|
|
36
|
+
def __init__(self, parent=None):
|
|
37
|
+
qt.QDialog.__init__(self, parent)
|
|
38
|
+
self.setLayout(qt.QVBoxLayout())
|
|
39
|
+
self._scrollArea = qt.QScrollArea(self)
|
|
40
|
+
self._scrollArea.setWidgetResizable(True)
|
|
41
|
+
self.content = qt.QTextEdit(self._scrollArea)
|
|
42
|
+
self.content.setReadOnly(True)
|
|
43
|
+
self._scrollArea.setWidget(self.content)
|
|
44
|
+
self.layout().addWidget(self._scrollArea)
|
|
45
|
+
|
|
46
|
+
# buttons
|
|
47
|
+
types = qt.QDialogButtonBox.Ok
|
|
48
|
+
self._buttons = qt.QDialogButtonBox(parent=self)
|
|
49
|
+
self._buttons.setStandardButtons(types)
|
|
50
|
+
self.layout().addWidget(self._buttons)
|
|
51
|
+
|
|
52
|
+
# connect signal / slots
|
|
53
|
+
self._buttons.button(qt.QDialogButtonBox.Ok).clicked.connect(self.accept)
|
|
54
|
+
|
|
55
|
+
def setInfos(self, infos):
|
|
56
|
+
self.content.setText(infos)
|
|
57
|
+
|
|
58
|
+
def sizeHint(self):
|
|
59
|
+
return qt.QSize(400, 400)
|
|
@@ -37,6 +37,7 @@ from processview.core.manager import ProcessManager as _ProcessManager
|
|
|
37
37
|
from processview.core.superviseprocess import SuperviseProcess
|
|
38
38
|
from processview.core.dataset import DatasetIdentifier
|
|
39
39
|
from processview.gui import icons as icons
|
|
40
|
+
from processview.gui.messagebox import MessageBox
|
|
40
41
|
from processview.utils import docstring
|
|
41
42
|
import fnmatch
|
|
42
43
|
|
|
@@ -47,6 +48,7 @@ _DATASET_STATE_BACKGROUND = {
|
|
|
47
48
|
DatasetState.FAILED: qt.QColor("#f52718"), # red
|
|
48
49
|
DatasetState.PENDING: qt.QColor("#609ab3"), # blue gray
|
|
49
50
|
DatasetState.SKIPPED: qt.QColor("#f08e0e"), # light orange
|
|
51
|
+
DatasetState.WAIT_USER_VALIDATION: qt.QColor("#cb34c1"), # pink
|
|
50
52
|
}
|
|
51
53
|
|
|
52
54
|
|
|
@@ -112,17 +114,16 @@ class ObservationTable(qt.QTableView):
|
|
|
112
114
|
def _requestInfo(self, *args, **kwargs):
|
|
113
115
|
process, dataset = self._target
|
|
114
116
|
if process is not None and dataset is not None:
|
|
115
|
-
msg = qt.QMessageBox(self)
|
|
116
|
-
msg.setIcon(qt.QMessageBox.Information)
|
|
117
|
-
|
|
118
117
|
infos = ProcessManager().get_dataset_details(
|
|
119
118
|
dataset=dataset, process=process
|
|
120
119
|
)
|
|
121
120
|
if infos in (None, ""):
|
|
122
121
|
infos = "No extra information provided"
|
|
122
|
+
|
|
123
|
+
msg = MessageBox(self)
|
|
124
|
+
msg.setInfos(infos=infos)
|
|
123
125
|
extra_info = "{} processing {}".format(process.name, dataset)
|
|
124
126
|
msg.setWindowTitle(extra_info)
|
|
125
|
-
msg.setText(infos)
|
|
126
127
|
msg.setWindowModality(qt.Qt.NonModal)
|
|
127
128
|
msg.show()
|
|
128
129
|
|
|
@@ -142,7 +143,6 @@ class ProcessManagerWidget(qt.QWidget):
|
|
|
142
143
|
|
|
143
144
|
self.observationTable = ObservationTable(self)
|
|
144
145
|
self.layout().addWidget(self.observationTable)
|
|
145
|
-
self.observationTable.setSelectionBehavior(qt.QAbstractItemView.SelectRows)
|
|
146
146
|
self.observationTable.setModel(
|
|
147
147
|
_DatasetProcessModel(parent=self.observationTable, header=tuple())
|
|
148
148
|
)
|
|
@@ -159,6 +159,7 @@ class ProcessManagerWidget(qt.QWidget):
|
|
|
159
159
|
self.filterWidget.filterWidget.sigProcessPatternEditingFinished.connect(
|
|
160
160
|
self._filterUpdated
|
|
161
161
|
)
|
|
162
|
+
self._manager.sigProcessUnregistered.connect(self._updateProcesses)
|
|
162
163
|
# update to fit existing processes / datasets
|
|
163
164
|
self._updateProcesses()
|
|
164
165
|
self._updateDatasetStates()
|
|
@@ -472,6 +473,9 @@ class ProcessManager(qt.QObject):
|
|
|
472
473
|
sigNewProcessRegistered = qt.Signal()
|
|
473
474
|
"""Signal emitted when a new process is registered"""
|
|
474
475
|
|
|
476
|
+
sigProcessUnregistered = qt.Signal()
|
|
477
|
+
"""Signal emitted when a process is unregistered"""
|
|
478
|
+
|
|
475
479
|
def __init__(self):
|
|
476
480
|
qt.QObject.__init__(self)
|
|
477
481
|
self.manager = _ProcessManager()
|
|
@@ -480,6 +484,7 @@ class ProcessManager(qt.QObject):
|
|
|
480
484
|
# TODO: add / remove callback would be simpler
|
|
481
485
|
self.manager.add_update_callback(self.updated)
|
|
482
486
|
self.manager.add_new_process_callback(self.processAdded)
|
|
487
|
+
self.manager.add_process_removed_callback(self.processRemoved)
|
|
483
488
|
|
|
484
489
|
def updated(self):
|
|
485
490
|
self.sigUpdated.emit()
|
|
@@ -487,6 +492,9 @@ class ProcessManager(qt.QObject):
|
|
|
487
492
|
def processAdded(self):
|
|
488
493
|
self.sigNewProcessRegistered.emit()
|
|
489
494
|
|
|
495
|
+
def processRemoved(self):
|
|
496
|
+
self.sigProcessUnregistered.emit()
|
|
497
|
+
|
|
490
498
|
def processNameChanged(self, process):
|
|
491
499
|
self.sigProcessNameChanged.emit(process)
|
|
492
500
|
|
|
@@ -496,8 +504,10 @@ class ProcessManager(qt.QObject):
|
|
|
496
504
|
|
|
497
505
|
# expose some of the original ProcessManager API
|
|
498
506
|
@docstring(_ProcessManager)
|
|
499
|
-
def notify_dataset_state(self, dataset, process, state) -> None:
|
|
500
|
-
self.manager.notify_dataset_state(
|
|
507
|
+
def notify_dataset_state(self, dataset, process, state, details=None) -> None:
|
|
508
|
+
self.manager.notify_dataset_state(
|
|
509
|
+
dataset=dataset, process=process, state=state, details=details
|
|
510
|
+
)
|
|
501
511
|
|
|
502
512
|
@docstring(_ProcessManager)
|
|
503
513
|
def get_dataset_state(self, dataset, process) -> Union[None, DatasetState]:
|
|
@@ -20,6 +20,7 @@ processview/core/manager/test/test_manager.py
|
|
|
20
20
|
processview/core/test/__init__.py
|
|
21
21
|
processview/gui/__init__.py
|
|
22
22
|
processview/gui/icons.py
|
|
23
|
+
processview/gui/messagebox.py
|
|
23
24
|
processview/gui/processmanager.py
|
|
24
25
|
processview/gui/test/__init__.py
|
|
25
26
|
processview/gui/test/test_process_manager.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|