Changeset 488c49d in sasview for src/sas/qtgui/UnitTesting/TestUtils.py
- Timestamp:
- Jun 8, 2016 9:56:28 AM (8 years ago)
- Branches:
- ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- 5032ea68
- Parents:
- f721030
- git-author:
- Piotr Rozyczko <piotr.rozyczko@…> (06/08/16 09:53:59)
- git-committer:
- Piotr Rozyczko <piotr.rozyczko@…> (06/08/16 09:56:28)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/UnitTesting/TestUtils.py
rf721030 r488c49d 12 12 super(QtSignalSpy, self).__init__(parent) 13 13 14 self._ connector = {}14 self._recorder = {} 15 15 self._count = 0 16 self._signal = [ None, None]16 self._signal = [] 17 17 18 18 # Assign our own slot to the emitted signal 19 if isinstance(signal, pyqtBoundSignal): 20 signal.connect(self.slot) 21 elif hasattr(widget, signal): 22 getattr(widget, signal).connect(self.slot) 23 else: 24 widget.signal.connect(slot) 19 try: 20 if isinstance(signal, pyqtBoundSignal): 21 signal.connect(self.slot) 22 elif hasattr(widget, signal): 23 getattr(widget, signal).connect(self.slot) 24 else: 25 widget.signal.connect(slot) 26 except AttributeError: 27 msg = "Wrong construction of QtSignalSpy instance" 28 raise RuntimeError, msg 25 29 26 30 def slot(self, *args, **kwargs): … … 28 32 Record emitted signal. 29 33 """ 30 self._ connector[self._count] = {34 self._recorder[self._count] = { 31 35 'args' : args, 32 36 'kwargs' : kwargs, … … 37 41 38 42 def signal(self, index=None): 39 """40 """41 43 if index == None: 42 44 return self._signal … … 45 47 46 48 def count(self): 47 """48 """49 49 return self._count 50 50 51 51 def called(self): 52 """ 53 """ 54 return self._connector 52 return self._recorder
Note: See TracChangeset
for help on using the changeset viewer.