Commit e0e1123d authored by Luke Campagnola's avatar Luke Campagnola
Browse files

fixed import statements python3 compatibility

PolyLineROI.getArrayRegion correctly applies mask to N-dimensional data
fixed multiprocess for python2.6 compatibility
parent 1a0b5921
from __main__ import run
from .__main__ import run
import sys, os, subprocess, time
import initExample
try:
from . import initExample
except ValueError:
sys.excepthook(*sys.exc_info())
print("examples/ can not be executed as a script; please run 'python -m examples' instead.")
sys.exit(1)
from pyqtgraph.Qt import QtCore, QtGui, USE_PYSIDE
if USE_PYSIDE:
from exampleLoaderTemplate_pyside import Ui_Form
from .exampleLoaderTemplate_pyside import Ui_Form
else:
from exampleLoaderTemplate_pyqt import Ui_Form
from .exampleLoaderTemplate_pyqt import Ui_Form
import os, sys
from pyqtgraph.pgcollections import OrderedDict
......
......@@ -154,7 +154,8 @@ def importModules(path, globals, locals, excludes=()):
try:
if len(path) > 0:
modName = path + '.' + modName
mod = __import__(modName, globals, locals, fromlist=['*'])
#mod = __import__(modName, globals, locals, fromlist=['*'])
mod = __import__(modName, globals, locals, ['*'], 1)
mods[modName] = mod
except:
import traceback
......
......@@ -1771,7 +1771,7 @@ class PolyLineROI(ROI):
shape = [1] * data.ndim
shape[axes[0]] = sliced.shape[axes[0]]
shape[axes[1]] = sliced.shape[axes[1]]
return sliced * mask
return sliced * mask.reshape(shape)
class LineSegmentROI(ROI):
......
......@@ -129,7 +129,7 @@ class Parallelize(object):
self.childs.append(proc)
## Keep track of the progress of each worker independently.
self.progress = {ch.childPid: [] for ch in self.childs}
self.progress = dict([(ch.childPid, []) for ch in self.childs])
## for each child process, self.progress[pid] is a list
## of task indexes. The last index is the task currently being
## processed; all others are finished.
......
......@@ -803,7 +803,7 @@ class ObjectProxy(object):
return val
def _getProxyOptions(self):
return {k: self._getProxyOption(k) for k in self._proxyOptions}
return dict([(k, self._getProxyOption(k)) for k in self._proxyOptions])
def __reduce__(self):
return (unpickleObjectProxy, (self._processId, self._proxyId, self._typeStr, self._attributes))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment