diff --git a/console/Console.py b/console/Console.py index 342af9ce..20e5dab8 100644 --- a/console/Console.py +++ b/console/Console.py @@ -236,6 +236,7 @@ class ConsoleWidget(QtGui.QWidget): if catch: self.ui.catchNextExceptionBtn.setChecked(False) exceptionHandling.register(self.allExceptionsHandler) + self.ui.exceptionBtn.setChecked(True) else: exceptionHandling.unregister(self.allExceptionsHandler) @@ -248,6 +249,7 @@ class ConsoleWidget(QtGui.QWidget): if catch: self.ui.catchAllExceptionsBtn.setChecked(False) exceptionHandling.register(self.nextExceptionHandler) + self.ui.exceptionBtn.setChecked(True) else: exceptionHandling.unregister(self.nextExceptionHandler) diff --git a/flowchart/Flowchart.py b/flowchart/Flowchart.py index 35f848fd..f0c9212f 100644 --- a/flowchart/Flowchart.py +++ b/flowchart/Flowchart.py @@ -515,6 +515,7 @@ class Flowchart(Node): self.sigChartLoaded.emit() self.outputChanged() + self.sigStateChanged.emit() #self.sigOutputChanged.emit() def loadFile(self, fileName=None, startDir=None): diff --git a/metaarray/MetaArray.py b/metaarray/MetaArray.py index c7935838..9cb6d492 100644 --- a/metaarray/MetaArray.py +++ b/metaarray/MetaArray.py @@ -855,12 +855,18 @@ class MetaArray(object): if 'close' in kargs and readAllData is None: ## for backward compatibility readAllData = kargs['close'] - if not HAVE_HDF5: - raise Exception("The file '%s' is HDF5-formatted, but the HDF5 library (h5py) was not found." % fileName) - if readAllData is True and writable is True: raise Exception("Incompatible arguments: readAllData=True and writable=True") + if not HAVE_HDF5: + try: + assert writable==False + assert readAllData != False + self._readHDF5Remote(fileName) + return + except: + raise Exception("The file '%s' is HDF5-formatted, but the HDF5 library (h5py) was not found." % fileName) + ## by default, readAllData=True for files < 500MB if readAllData is None: size = os.stat(fileName).st_size @@ -884,6 +890,29 @@ class MetaArray(object): else: self._data = f['data'][:] f.close() + + def _readHDF5Remote(self, fileName): + ## Used to read HDF5 files via remote process. + ## This is needed in the case that HDF5 is not importable due to the use of python-dbg. + proc = getattr(MetaArray, '_hdf5Process', None) + + if proc == False: + raise Exception('remote read failed') + if proc == None: + import pyqtgraph.multiprocess as mp + #print "new process" + proc = mp.Process(executable='/usr/bin/python') + proc.setProxyOptions(deferGetattr=True) + MetaArray._hdf5Process = proc + MetaArray._h5py_metaarray = proc._import('pyqtgraph.metaarray') + ma = MetaArray._h5py_metaarray.MetaArray(file=fileName) + self._data = ma.asarray()._getValue() + self._info = ma._info._getValue() + #print MetaArray._hdf5Process + #import inspect + #print MetaArray, id(MetaArray), inspect.getmodule(MetaArray) + + @staticmethod def mapHDF5Array(data, writable=False):