Enforced LF file endings

removed stray print statement
This commit is contained in:
Luke Campagnola 2012-05-23 20:29:16 -04:00
parent 4d1a5ded1b
commit 0f1f6c62e4
7 changed files with 40 additions and 41 deletions

View File

@ -1,41 +1,41 @@
from pyqtgraph.Qt import QtCore, QtGui from pyqtgraph.Qt import QtCore, QtGui
class ThreadsafeTimer(QtCore.QObject): class ThreadsafeTimer(QtCore.QObject):
""" """
Thread-safe replacement for QTimer. Thread-safe replacement for QTimer.
""" """
timeout = QtCore.Signal() timeout = QtCore.Signal()
sigTimerStopRequested = QtCore.Signal() sigTimerStopRequested = QtCore.Signal()
sigTimerStartRequested = QtCore.Signal(object) sigTimerStartRequested = QtCore.Signal(object)
def __init__(self): def __init__(self):
QtCore.QObject.__init__(self) QtCore.QObject.__init__(self)
self.timer = QtCore.QTimer() self.timer = QtCore.QTimer()
self.timer.timeout.connect(self.timerFinished) self.timer.timeout.connect(self.timerFinished)
self.timer.moveToThread(QtCore.QCoreApplication.instance().thread()) self.timer.moveToThread(QtCore.QCoreApplication.instance().thread())
self.moveToThread(QtCore.QCoreApplication.instance().thread()) self.moveToThread(QtCore.QCoreApplication.instance().thread())
self.sigTimerStopRequested.connect(self.stop, QtCore.Qt.QueuedConnection) self.sigTimerStopRequested.connect(self.stop, QtCore.Qt.QueuedConnection)
self.sigTimerStartRequested.connect(self.start, QtCore.Qt.QueuedConnection) self.sigTimerStartRequested.connect(self.start, QtCore.Qt.QueuedConnection)
def start(self, timeout): def start(self, timeout):
isGuiThread = QtCore.QThread.currentThread() == QtCore.QCoreApplication.instance().thread() isGuiThread = QtCore.QThread.currentThread() == QtCore.QCoreApplication.instance().thread()
if isGuiThread: if isGuiThread:
#print "start timer", self, "from gui thread" #print "start timer", self, "from gui thread"
self.timer.start(timeout) self.timer.start(timeout)
else: else:
#print "start timer", self, "from remote thread" #print "start timer", self, "from remote thread"
self.sigTimerStartRequested.emit(timeout) self.sigTimerStartRequested.emit(timeout)
def stop(self): def stop(self):
isGuiThread = QtCore.QThread.currentThread() == QtCore.QCoreApplication.instance().thread() isGuiThread = QtCore.QThread.currentThread() == QtCore.QCoreApplication.instance().thread()
if isGuiThread: if isGuiThread:
#print "stop timer", self, "from gui thread" #print "stop timer", self, "from gui thread"
self.timer.stop() self.timer.stop()
else: else:
#print "stop timer", self, "from remote thread" #print "stop timer", self, "from remote thread"
self.sigTimerStopRequested.emit() self.sigTimerStopRequested.emit()
def timerFinished(self): def timerFinished(self):
self.timeout.emit() self.timeout.emit()

0
examples/Arrow.py Executable file → Normal file
View File

0
examples/GraphicsLayout.py Executable file → Normal file
View File

0
examples/ScatterPlot.py Executable file → Normal file
View File

0
examples/ViewBox.py Executable file → Normal file
View File

View File

@ -247,7 +247,6 @@ class PlotDataItem(GraphicsObject):
if len(args) == 1: if len(args) == 1:
data = args[0] data = args[0]
dt = dataType(data) dt = dataType(data)
print "plot:", dt, type(data)
if dt == 'empty': if dt == 'empty':
pass pass
elif dt == 'listOfValues': elif dt == 'listOfValues':

0
graphicsItems/ROI.py Executable file → Normal file
View File