processview 0.1.2b1__tar.gz → 0.2.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 (64) hide show
  1. users/payno/.local/share/virtualenvs/tomwer_venc/lib/python3.7/site-packages/processview/__pycache__/__init__.cpython-37.pyc +0 -0
  2. {home/payno/.local/share/virtualenvs/tomwer_venv → users/payno/.local/share/virtualenvs/tomwer_venc}/lib/python3.7/site-packages/processview/__pycache__/setup.cpython-37.pyc +0 -0
  3. {home/payno/.local/share/virtualenvs/tomwer_venv → users/payno/.local/share/virtualenvs/tomwer_venc}/lib/python3.7/site-packages/processview/__pycache__/version.cpython-37.pyc +0 -0
  4. users/payno/.local/share/virtualenvs/tomwer_venc/lib/python3.7/site-packages/processview/core/__pycache__/__init__.cpython-37.pyc +0 -0
  5. {home/payno/.local/share/virtualenvs/tomwer_venv → users/payno/.local/share/virtualenvs/tomwer_venc}/lib/python3.7/site-packages/processview/core/__pycache__/dataset.cpython-37.pyc +0 -0
  6. {home/payno/.local/share/virtualenvs/tomwer_venv → users/payno/.local/share/virtualenvs/tomwer_venc}/lib/python3.7/site-packages/processview/core/__pycache__/setup.cpython-37.pyc +0 -0
  7. {home/payno/.local/share/virtualenvs/tomwer_venv → users/payno/.local/share/virtualenvs/tomwer_venc}/lib/python3.7/site-packages/processview/core/__pycache__/superviseprocess.cpython-37.pyc +0 -0
  8. users/payno/.local/share/virtualenvs/tomwer_venc/lib/python3.7/site-packages/processview/core/manager/__pycache__/__init__.cpython-37.pyc +0 -0
  9. {home/payno/.local/share/virtualenvs/tomwer_venv → users/payno/.local/share/virtualenvs/tomwer_venc}/lib/python3.7/site-packages/processview/core/manager/__pycache__/manager.cpython-37.pyc +0 -0
  10. {home/payno/.local/share/virtualenvs/tomwer_venv → users/payno/.local/share/virtualenvs/tomwer_venc}/lib/python3.7/site-packages/processview/core/manager/manager.py +3 -0
  11. users/payno/.local/share/virtualenvs/tomwer_venc/lib/python3.7/site-packages/processview/core/manager/test/__pycache__/__init__.cpython-37.pyc +0 -0
  12. users/payno/.local/share/virtualenvs/tomwer_venc/lib/python3.7/site-packages/processview/core/manager/test/__pycache__/test_manager.cpython-37.pyc +0 -0
  13. {home/payno/.local/share/virtualenvs/tomwer_venv → users/payno/.local/share/virtualenvs/tomwer_venc}/lib/python3.7/site-packages/processview/core/manager/test/test_manager.py +21 -2
  14. users/payno/.local/share/virtualenvs/tomwer_venc/lib/python3.7/site-packages/processview/core/test/__pycache__/__init__.cpython-37.pyc +0 -0
  15. users/payno/.local/share/virtualenvs/tomwer_venc/lib/python3.7/site-packages/processview/gui/__pycache__/__init__.cpython-37.pyc +0 -0
  16. {home/payno/.local/share/virtualenvs/tomwer_venv → users/payno/.local/share/virtualenvs/tomwer_venc}/lib/python3.7/site-packages/processview/gui/__pycache__/icons.cpython-37.pyc +0 -0
  17. users/payno/.local/share/virtualenvs/tomwer_venc/lib/python3.7/site-packages/processview/gui/__pycache__/messagebox.cpython-37.pyc +0 -0
  18. users/payno/.local/share/virtualenvs/tomwer_venc/lib/python3.7/site-packages/processview/gui/__pycache__/processmanager.cpython-37.pyc +0 -0
  19. users/payno/.local/share/virtualenvs/tomwer_venc/lib/python3.7/site-packages/processview/gui/messagebox.py +59 -0
  20. {home/payno/.local/share/virtualenvs/tomwer_venv → users/payno/.local/share/virtualenvs/tomwer_venc}/lib/python3.7/site-packages/processview/gui/processmanager.py +31 -6
  21. users/payno/.local/share/virtualenvs/tomwer_venc/lib/python3.7/site-packages/processview/gui/test/__init__.py +38 -0
  22. users/payno/.local/share/virtualenvs/tomwer_venc/lib/python3.7/site-packages/processview/gui/test/__pycache__/__init__.cpython-37.pyc +0 -0
  23. users/payno/.local/share/virtualenvs/tomwer_venc/lib/python3.7/site-packages/processview/gui/test/__pycache__/test_process_manager.cpython-37.pyc +0 -0
  24. users/payno/.local/share/virtualenvs/tomwer_venc/lib/python3.7/site-packages/processview/gui/test/test_process_manager.py +108 -0
  25. {home/payno/.local/share/virtualenvs/tomwer_venv → users/payno/.local/share/virtualenvs/tomwer_venc}/lib/python3.7/site-packages/processview/resources/__pycache__/__init__.cpython-37.pyc +0 -0
  26. {home/payno/.local/share/virtualenvs/tomwer_venv → users/payno/.local/share/virtualenvs/tomwer_venc}/lib/python3.7/site-packages/processview/test/__init__.py +2 -0
  27. users/payno/.local/share/virtualenvs/tomwer_venc/lib/python3.7/site-packages/processview/test/__pycache__/__init__.cpython-37.pyc +0 -0
  28. {home/payno/.local/share/virtualenvs/tomwer_venv → users/payno/.local/share/virtualenvs/tomwer_venc}/lib/python3.7/site-packages/processview/utils/__pycache__/__init__.cpython-37.pyc +0 -0
  29. users/payno/.local/share/virtualenvs/tomwer_venc/lib/python3.7/site-packages/processview/utils/__pycache__/singleton.cpython-37.pyc +0 -0
  30. {home/payno/.local/share/virtualenvs/tomwer_venv → users/payno/.local/share/virtualenvs/tomwer_venc}/lib/python3.7/site-packages/processview/version.py +4 -4
  31. {home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview-0.1.2b1-py3.7.egg-info → users/payno/.local/share/virtualenvs/tomwer_venc/lib/python3.7/site-packages/processview-0.2.0-py3.7.egg-info}/PKG-INFO +1 -1
  32. {home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview-0.1.2b1-py3.7.egg-info → users/payno/.local/share/virtualenvs/tomwer_venc/lib/python3.7/site-packages/processview-0.2.0-py3.7.egg-info}/SOURCES.txt +3 -0
  33. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview/__pycache__/__init__.cpython-37.pyc +0 -0
  34. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview/core/__pycache__/__init__.cpython-37.pyc +0 -0
  35. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview/core/manager/__pycache__/__init__.cpython-37.pyc +0 -0
  36. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview/core/manager/test/__pycache__/__init__.cpython-37.pyc +0 -0
  37. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview/core/manager/test/__pycache__/test_manager.cpython-37.pyc +0 -0
  38. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview/core/test/__pycache__/__init__.cpython-37.pyc +0 -0
  39. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview/gui/__pycache__/__init__.cpython-37.pyc +0 -0
  40. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview/gui/__pycache__/processmanager.cpython-37.pyc +0 -0
  41. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview/test/__pycache__/__init__.cpython-37.pyc +0 -0
  42. home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview/utils/__pycache__/singleton.cpython-37.pyc +0 -0
  43. {home/payno/.local/share/virtualenvs/tomwer_venv → users/payno/.local/share/virtualenvs/tomwer_venc}/lib/python3.7/site-packages/processview/__init__.py +0 -0
  44. {home/payno/.local/share/virtualenvs/tomwer_venv → users/payno/.local/share/virtualenvs/tomwer_venc}/lib/python3.7/site-packages/processview/core/__init__.py +0 -0
  45. {home/payno/.local/share/virtualenvs/tomwer_venv → users/payno/.local/share/virtualenvs/tomwer_venc}/lib/python3.7/site-packages/processview/core/dataset.py +0 -0
  46. {home/payno/.local/share/virtualenvs/tomwer_venv → users/payno/.local/share/virtualenvs/tomwer_venc}/lib/python3.7/site-packages/processview/core/manager/__init__.py +0 -0
  47. {home/payno/.local/share/virtualenvs/tomwer_venv → users/payno/.local/share/virtualenvs/tomwer_venc}/lib/python3.7/site-packages/processview/core/manager/test/__init__.py +0 -0
  48. {home/payno/.local/share/virtualenvs/tomwer_venv → users/payno/.local/share/virtualenvs/tomwer_venc}/lib/python3.7/site-packages/processview/core/setup.py +0 -0
  49. {home/payno/.local/share/virtualenvs/tomwer_venv → users/payno/.local/share/virtualenvs/tomwer_venc}/lib/python3.7/site-packages/processview/core/superviseprocess.py +0 -0
  50. {home/payno/.local/share/virtualenvs/tomwer_venv → users/payno/.local/share/virtualenvs/tomwer_venc}/lib/python3.7/site-packages/processview/core/test/__init__.py +0 -0
  51. {home/payno/.local/share/virtualenvs/tomwer_venv → users/payno/.local/share/virtualenvs/tomwer_venc}/lib/python3.7/site-packages/processview/gui/__init__.py +0 -0
  52. {home/payno/.local/share/virtualenvs/tomwer_venv → users/payno/.local/share/virtualenvs/tomwer_venc}/lib/python3.7/site-packages/processview/gui/icons.py +0 -0
  53. {home/payno/.local/share/virtualenvs/tomwer_venv → users/payno/.local/share/virtualenvs/tomwer_venc}/lib/python3.7/site-packages/processview/resources/__init__.py +0 -0
  54. {home/payno/.local/share/virtualenvs/tomwer_venv → users/payno/.local/share/virtualenvs/tomwer_venc}/lib/python3.7/site-packages/processview/resources/gui/icons/advancement.png +0 -0
  55. {home/payno/.local/share/virtualenvs/tomwer_venv → users/payno/.local/share/virtualenvs/tomwer_venc}/lib/python3.7/site-packages/processview/resources/gui/icons/advancement.svg +0 -0
  56. {home/payno/.local/share/virtualenvs/tomwer_venv → users/payno/.local/share/virtualenvs/tomwer_venc}/lib/python3.7/site-packages/processview/resources/gui/icons/magnifying_glass.png +0 -0
  57. {home/payno/.local/share/virtualenvs/tomwer_venv → users/payno/.local/share/virtualenvs/tomwer_venc}/lib/python3.7/site-packages/processview/resources/gui/icons/magnifying_glass.svg +0 -0
  58. {home/payno/.local/share/virtualenvs/tomwer_venv → users/payno/.local/share/virtualenvs/tomwer_venc}/lib/python3.7/site-packages/processview/setup.py +0 -0
  59. {home/payno/.local/share/virtualenvs/tomwer_venv → users/payno/.local/share/virtualenvs/tomwer_venc}/lib/python3.7/site-packages/processview/utils/__init__.py +0 -0
  60. {home/payno/.local/share/virtualenvs/tomwer_venv → users/payno/.local/share/virtualenvs/tomwer_venc}/lib/python3.7/site-packages/processview/utils/singleton.py +0 -0
  61. {home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview-0.1.2b1-py3.7.egg-info → users/payno/.local/share/virtualenvs/tomwer_venc/lib/python3.7/site-packages/processview-0.2.0-py3.7.egg-info}/dependency_links.txt +0 -0
  62. {home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview-0.1.2b1-py3.7.egg-info → users/payno/.local/share/virtualenvs/tomwer_venc/lib/python3.7/site-packages/processview-0.2.0-py3.7.egg-info}/not-zip-safe +0 -0
  63. {home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview-0.1.2b1-py3.7.egg-info → users/payno/.local/share/virtualenvs/tomwer_venc/lib/python3.7/site-packages/processview-0.2.0-py3.7.egg-info}/requires.txt +0 -0
  64. {home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview-0.1.2b1-py3.7.egg-info → users/payno/.local/share/virtualenvs/tomwer_venc/lib/python3.7/site-packages/processview-0.2.0-py3.7.egg-info}/top_level.txt +0 -0
@@ -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
@@ -74,6 +75,8 @@ class ProcessManager:
74
75
  """check if a dataset has already met a dataset"""
75
76
  if isinstance(dataset, DatasetIdentifier):
76
77
  dataset_id = dataset
78
+ elif dataset is None:
79
+ return False
77
80
  else:
78
81
  dataset_id = dataset.get_dataset_identifier()
79
82
  if process.process_id in self._dataset_process_states:
@@ -33,6 +33,7 @@ from processview.core.superviseprocess import SuperviseProcess
33
33
  from processview.core.manager import ProcessManager
34
34
  from processview.core.manager import DatasetState
35
35
  from processview.core.dataset import Dataset
36
+ from processview.core.dataset import DatasetIdentifier
36
37
  import gc
37
38
 
38
39
 
@@ -99,7 +100,10 @@ class TestProcessManager(unittest.TestCase):
99
100
  # test 'getProcessHistory'
100
101
  self.assertEqual(
101
102
  manager.get_process_history(process=p1),
102
- ((str(scan_1), DatasetState.PENDING), (str(scan_2), DatasetState.SUCCEED)),
103
+ (
104
+ (scan_1.get_dataset_identifier(), DatasetState.PENDING),
105
+ (scan_2.get_dataset_identifier(), DatasetState.SUCCEED),
106
+ ),
103
107
  )
104
108
 
105
109
 
@@ -111,9 +115,24 @@ class _DummyScan(Dataset):
111
115
  def __str__(self) -> str:
112
116
  return self.name
113
117
 
114
- def short_str(self):
118
+ def get_dataset_identifier(self) -> DatasetIdentifier:
119
+ return _DummyIdentifier(self)
120
+
121
+
122
+ class _DummyIdentifier(DatasetIdentifier):
123
+ def __init__(self, dataset):
124
+ super().__init__(dataset)
125
+ self.name = dataset.name
126
+
127
+ def __str__(self):
115
128
  return self.name
116
129
 
130
+ def __eq__(self, other):
131
+ return self.name == other.name
132
+
133
+ def __hash__(self):
134
+ return hash(self.name)
135
+
117
136
 
118
137
  def suite():
119
138
  test_suite = unittest.TestSuite()
@@ -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
 
@@ -66,10 +68,16 @@ class ProcessManagerWindow(qt.QMainWindow):
66
68
  class ObservationTable(qt.QTableView):
67
69
  def __init__(self, parent):
68
70
  qt.QTableView.__init__(self, parent)
71
+
72
+ # QMenu
69
73
  self.menu = qt.QMenu()
70
- self.action = qt.QAction("reprocess")
71
- self.action.triggered.connect(self._requestReprocessing)
72
- self.menu.addAction(self.action)
74
+ self._reprocessAction = qt.QAction("reprocess")
75
+ self._reprocessAction.triggered.connect(self._requestReprocessing)
76
+ self.menu.addAction(self._reprocessAction)
77
+ self._infoAction = qt.QAction("info")
78
+ self._infoAction.triggered.connect(self._requestInfo)
79
+ self.menu.addAction(self._infoAction)
80
+
73
81
  self._target = (None, None)
74
82
  # register target of the last menu (process, DatasetIdentifier)
75
83
 
@@ -103,6 +111,22 @@ class ObservationTable(qt.QTableView):
103
111
  assert isinstance(dataset, DatasetIdentifier)
104
112
  process.reprocess(dataset.recreate_dataset())
105
113
 
114
+ def _requestInfo(self, *args, **kwargs):
115
+ process, dataset = self._target
116
+ if process is not None and dataset is not None:
117
+ infos = ProcessManager().get_dataset_details(
118
+ dataset=dataset, process=process
119
+ )
120
+ if infos in (None, ""):
121
+ infos = "No extra information provided"
122
+
123
+ msg = MessageBox(self)
124
+ msg.setInfos(infos=infos)
125
+ extra_info = "{} processing {}".format(process.name, dataset)
126
+ msg.setWindowTitle(extra_info)
127
+ msg.setWindowModality(qt.Qt.NonModal)
128
+ msg.show()
129
+
106
130
 
107
131
  class ProcessManagerWidget(qt.QWidget):
108
132
  def __init__(self, parent):
@@ -119,7 +143,6 @@ class ProcessManagerWidget(qt.QWidget):
119
143
 
120
144
  self.observationTable = ObservationTable(self)
121
145
  self.layout().addWidget(self.observationTable)
122
- self.observationTable.setSelectionBehavior(qt.QAbstractItemView.SelectRows)
123
146
  self.observationTable.setModel(
124
147
  _DatasetProcessModel(parent=self.observationTable, header=tuple())
125
148
  )
@@ -473,8 +496,10 @@ class ProcessManager(qt.QObject):
473
496
 
474
497
  # expose some of the original ProcessManager API
475
498
  @docstring(_ProcessManager)
476
- def notify_dataset_state(self, dataset, process, state) -> None:
477
- self.manager.notify_dataset_state(dataset=dataset, process=process, state=state)
499
+ def notify_dataset_state(self, dataset, process, state, details=None) -> None:
500
+ self.manager.notify_dataset_state(
501
+ dataset=dataset, process=process, state=state, details=details
502
+ )
478
503
 
479
504
  @docstring(_ProcessManager)
480
505
  def get_dataset_state(self, dataset, process) -> Union[None, DatasetState]:
@@ -0,0 +1,38 @@
1
+ # coding: utf-8
2
+ # /*##########################################################################
3
+ #
4
+ # Copyright (c) 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
+ __authors__ = ["H.Payno"]
27
+ __license__ = "MIT"
28
+ __date__ = "01/02/2021"
29
+
30
+ import unittest
31
+
32
+ from .test_process_manager import suite as test_process_manager_suite
33
+
34
+
35
+ def suite():
36
+ test_suite = unittest.TestSuite()
37
+ test_suite.addTest(test_process_manager_suite())
38
+ return test_suite
@@ -0,0 +1,108 @@
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
+ __authors__ = ["H. Payno"]
27
+ __license__ = "MIT"
28
+ __date__ = "02/11/2020"
29
+
30
+
31
+ import unittest
32
+ from processview.core.superviseprocess import SuperviseProcess
33
+ from processview.core.dataset import Dataset
34
+ from processview.core.dataset import DatasetIdentifier
35
+ from processview.gui.processmanager import ProcessManager
36
+ from processview.core.manager import DatasetState
37
+ from silx.gui.utils.testutils import SignalListener
38
+ from silx.gui.utils.testutils import TestCaseQt
39
+ import gc
40
+
41
+
42
+ class TestProcessManager(TestCaseQt):
43
+ """
44
+ test ProcessManager
45
+ """
46
+
47
+ def setUp(self):
48
+ TestCaseQt.setUp(self)
49
+ self.signalListener = SignalListener()
50
+ self.manager = ProcessManager()
51
+ self.manager.sigUpdated.connect(self.signalListener)
52
+
53
+ def tearDown(self):
54
+ self.signalListener = None
55
+ self.processManager = None
56
+ gc.collect()
57
+ TestCaseQt.tearDown(self)
58
+
59
+ def testProcessStatesUpdate(self):
60
+ """insure providing states works well"""
61
+ p1 = SuperviseProcess()
62
+ p2 = SuperviseProcess()
63
+ scan_1 = _DummyScan("scan1")
64
+ scan_2 = _DummyScan("scan2")
65
+ self.manager.notify_dataset_state(
66
+ dataset=scan_1, state=DatasetState.PENDING, process=p1
67
+ )
68
+ self.manager.notify_dataset_state(
69
+ dataset=scan_2, state=DatasetState.SUCCEED, process=p1
70
+ )
71
+ self.manager.notify_dataset_state(
72
+ dataset=scan_2, state=DatasetState.FAILED, process=p2
73
+ )
74
+ self.assertEqual(self.signalListener.callCount(), 3)
75
+
76
+
77
+ class _DummyScan(Dataset):
78
+ def __init__(self, name):
79
+ super().__init__()
80
+ self.name = name
81
+
82
+ def __str__(self) -> str:
83
+ return self.name
84
+
85
+ def get_dataset_identifier(self) -> DatasetIdentifier:
86
+ return _DummyIdentifier(self)
87
+
88
+
89
+ class _DummyIdentifier(DatasetIdentifier):
90
+ def __init__(self, dataset):
91
+ super().__init__(dataset)
92
+ self.name = dataset.name
93
+
94
+ def __str__(self):
95
+ return self.name
96
+
97
+ def __eq__(self, other):
98
+ return self.name == other.name
99
+
100
+ def __hash__(self):
101
+ return hash(self.name)
102
+
103
+
104
+ def suite():
105
+ test_suite = unittest.TestSuite()
106
+ for ui in (TestProcessManager,):
107
+ test_suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(ui))
108
+ return test_suite
@@ -30,11 +30,13 @@ __date__ = "29/01/2021"
30
30
 
31
31
  import unittest
32
32
  from ..core import test as test_core
33
+ from ..gui import test as test_gui
33
34
 
34
35
 
35
36
  def suite(loader=None):
36
37
  test_suite = unittest.TestSuite()
37
38
  test_suite.addTest(test_core.suite())
39
+ test_suite.addTest(test_gui.suite())
38
40
 
39
41
  return test_suite
40
42
 
@@ -76,10 +76,10 @@ RELEASE_LEVEL_VALUE = {
76
76
  }
77
77
 
78
78
  MAJOR = 0
79
- MINOR = 1
80
- MICRO = 2
81
- RELEV = "rc" # <16
82
- SERIAL = 1 # <16
79
+ MINOR = 2
80
+ MICRO = 0
81
+ RELEV = "final" # <16
82
+ SERIAL = 0 # <16
83
83
 
84
84
  date = __date__
85
85
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: processview
3
- Version: 0.1.2b1
3
+ Version: 0.2.0
4
4
  Summary: Library workflow process supervision
5
5
  Home-page: https://gitlab.esrf.fr/workflow/processview
6
6
  Author: data analysis unit
@@ -20,7 +20,10 @@ 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
25
+ processview/gui/test/__init__.py
26
+ processview/gui/test/test_process_manager.py
24
27
  processview/resources/__init__.py
25
28
  processview/resources/gui/icons/advancement.png
26
29
  processview/resources/gui/icons/advancement.svg