merge from Luke

This commit is contained in:
Megan Kratz 2012-11-29 16:53:24 -05:00
commit 374e134014
30 changed files with 158 additions and 35 deletions

View File

@ -3,7 +3,7 @@ from pyqtgraph.Qt import QtCore, QtGui
import weakref
import pyqtgraph.ptime as ptime
class MouseDragEvent:
class MouseDragEvent(object):
"""
Instances of this class are delivered to items in a :class:`GraphicsScene <pyqtgraph.GraphicsScene>` via their mouseDragEvent() method when the item is being mouse-dragged.
@ -144,7 +144,7 @@ class MouseDragEvent:
class MouseClickEvent:
class MouseClickEvent(object):
"""
Instances of this class are delivered to items in a :class:`GraphicsScene <pyqtgraph.GraphicsScene>` via their mouseClickEvent() method when the item is clicked.
@ -229,7 +229,7 @@ class MouseClickEvent:
class HoverEvent:
class HoverEvent(object):
"""
Instances of this class are delivered to items in a :class:`GraphicsScene <pyqtgraph.GraphicsScene>` via their hoverEvent() method when the mouse is hovering over the item.
This event class both informs items that the mouse cursor is nearby and allows items to

View File

@ -317,7 +317,7 @@ def objectSize(obj, ignore=None, verbose=False, depth=0, recursive=False):
#print indent + ' -', k, len(refs)
return size
class GarbageWatcher:
class GarbageWatcher(object):
"""
Convenient dictionary for holding weak references to objects.
Mainly used to check whether the objects have been collect yet or not.
@ -356,7 +356,7 @@ class GarbageWatcher:
return self.objs[item]
class Profiler:
class Profiler(object):
"""Simple profiler allowing measurement of multiple time intervals.
Example:
@ -451,7 +451,7 @@ def lookup(oid, objects=None):
class ObjTracker:
class ObjTracker(object):
"""
Tracks all objects under the sun, reporting the changes between snapshots: what objects are created, deleted, and persistent.
This class is very useful for tracking memory leaks. The class goes to great (but not heroic) lengths to avoid tracking

View File

@ -0,0 +1,8 @@
GLSurfacePlotItem
=================
.. autoclass:: pyqtgraph.opengl.GLSurfacePlotItem
:members:
.. automethod:: pyqtgraph.opengl.GLSurfacePlotItem.__init__

View File

@ -16,9 +16,10 @@ Contents:
glviewwidget
glgriditem
glmeshitem
glsurfaceplotitem
glvolumeitem
glimageitem
glmeshitem
glaxisitem
glgraphicsitem
glscatterplotitem

View File

@ -5,5 +5,4 @@ MeshData
:members:
.. automethod:: pyqtgraph.opengl.MeshData.MeshData.__init__
.. automethod:: pyqtgraph.opengl.MeshData.MeshData.__iter__

View File

@ -0,0 +1,8 @@
FillBetweenItem
===============
.. autoclass:: pyqtgraph.FillBetweenItem
:members:
.. automethod:: pyqtgraph.FillBetweenItem.__init__

View File

@ -0,0 +1,8 @@
GraphicsWidgetAnchor
====================
.. autoclass:: pyqtgraph.GraphicsWidgetAnchor
:members:
.. automethod:: pyqtgraph.GraphicsWidgetAnchor.__init__

View File

@ -23,6 +23,7 @@ Contents:
axisitem
textitem
arrowitem
fillbetweenitem
curvepoint
curvearrow
griditem
@ -38,4 +39,5 @@ Contents:
graphicswidget
graphicsitem
uigraphicsitem
graphicswidgetanchor

View File

@ -0,0 +1,8 @@
BusyCursor
==========
.. autoclass:: pyqtgraph.BusyCursor
:members:
.. automethod:: pyqtgraph.BusyCursor.__init__

View File

@ -0,0 +1,8 @@
ComboBox
========
.. autoclass:: pyqtgraph.ComboBox
:members:
.. automethod:: pyqtgraph.ComboBox.__init__

View File

@ -0,0 +1,8 @@
FeedbackButton
==============
.. autoclass:: pyqtgraph.FeedbackButton
:members:
.. automethod:: pyqtgraph.FeedbackButton.__init__

View File

@ -30,4 +30,11 @@ Contents:
joystickbutton
multiplotwidget
verticallabel
remotegraphicsview
matplotlibwidget
feedbackbutton
combobox
layoutwidget
pathbutton
valuelabel
busycursor

View File

@ -0,0 +1,8 @@
LayoutWidget
============
.. autoclass:: pyqtgraph.LayoutWidget
:members:
.. automethod:: pyqtgraph.LayoutWidget.__init__

View File

@ -0,0 +1,8 @@
MatplotlibWidget
================
.. autoclass:: pyqtgraph.widgets.MatplotlibWidget.MatplotlibWidget
:members:
.. automethod:: pyqtgraph.widgets.MatplotlibWidget.MatplotlibWidget.__init__

View File

@ -0,0 +1,8 @@
PathButton
==========
.. autoclass:: pyqtgraph.PathButton
:members:
.. automethod:: pyqtgraph.PathButton.__init__

View File

@ -0,0 +1,8 @@
RemoteGraphicsView
==================
.. autoclass:: pyqtgraph.widgets.RemoteGraphicsView.RemoteGraphicsView
:members:
.. automethod:: pyqtgraph.widgets.RemoteGraphicsView.RemoteGraphicsView.__init__

View File

@ -0,0 +1,8 @@
ValueLabel
==========
.. autoclass:: pyqtgraph.ValueLabel
:members:
.. automethod:: pyqtgraph.ValueLabel.__init__

View File

@ -47,7 +47,7 @@ def setTracebackClearing(clear=True):
global clear_tracebacks
clear_tracebacks = clear
class ExceptionHandler:
class ExceptionHandler(object):
def __call__(self, *args):
## call original exception handler first (prints exception)
global original_excepthook, callbacks, clear_tracebacks

View File

@ -7,7 +7,7 @@ from pyqtgraph.Point import Point
#from PySide import QtCore, QtGui
from .eq import *
class Terminal:
class Terminal(object):
def __init__(self, node, name, io, optional=False, multi=False, pos=None, renamable=False, removable=False, multiable=False, bypass=None):
"""
Construct a new terminal.

View File

@ -0,0 +1,23 @@
import pyqtgraph as pg
class FillBetweenItem(pg.QtGui.QGraphicsPathItem):
"""
GraphicsItem filling the space between two PlotDataItems.
"""
def __init__(self, p1, p2, brush=None):
pg.QtGui.QGraphicsPathItem.__init__(self)
self.p1 = p1
self.p2 = p2
p1.sigPlotChanged.connect(self.updatePath)
p2.sigPlotChanged.connect(self.updatePath)
if brush is not None:
self.setBrush(pg.mkBrush(brush))
self.setZValue(min(p1.zValue(), p2.zValue())-1)
self.updatePath()
def updatePath(self):
p1 = self.p1.curve.path
p2 = self.p2.curve.path
path = pg.QtGui.QPainterPath()
path.addPolygon(p1.toSubpathPolygons()[0] + p2.toReversed().toSubpathPolygons()[0])
self.setPath(path)

View File

@ -2,7 +2,7 @@ from ..Qt import QtGui, QtCore
from ..Point import Point
class GraphicsWidgetAnchor:
class GraphicsWidgetAnchor(object):
"""
Class used to allow GraphicsWidgets to anchor to a specific position on their
parent.

View File

@ -77,7 +77,7 @@ def makeSymbolPixmap(size, pen, brush, symbol):
img = renderSymbol(symbol, size, pen, brush)
return QtGui.QPixmap(img)
class SymbolAtlas:
class SymbolAtlas(object):
"""
Used to efficiently construct a single QPixmap containing all rendered symbols
for a ScatterPlotItem. This is required for fragment rendering.

View File

@ -48,7 +48,7 @@ def axis(name=None, cols=None, values=None, units=None):
ax['cols'].append(col)
return ax
class sliceGenerator:
class sliceGenerator(object):
"""Just a compact way to generate tuples of slice objects."""
def __getitem__(self, arg):
return arg

View File

@ -6,7 +6,7 @@ class CanceledError(Exception):
"""Raised when the progress dialog is canceled during a processing operation."""
pass
class Parallelize:
class Parallelize(object):
"""
Class for ultra-simple inline parallelization on multi-core CPUs
@ -233,7 +233,7 @@ class Parallelize:
self.progress[pid].append(i)
class Tasker:
class Tasker(object):
def __init__(self, parallelizer, process, tasks, kwds):
self.proc = process
self.par = parallelizer

View File

@ -431,7 +431,7 @@ class RemoteEventHandler(object):
return LocalObjectProxy(obj)
class Request:
class Request(object):
"""
Request objects are returned when calling an ObjectProxy in asynchronous mode
or if a synchronous call has timed out. Use hasResult() to ask whether

View File

@ -209,7 +209,7 @@ CompiledShaderPrograms = {}
def getShaderProgram(name):
return ShaderProgram.names[name]
class Shader:
class Shader(object):
def __init__(self, shaderType, code):
self.shaderType = shaderType
self.code = code
@ -260,7 +260,7 @@ class FragmentShader(Shader):
class ShaderProgram:
class ShaderProgram(object):
names = {}
def __init__(self, name, shaders, uniforms=None):

View File

@ -665,7 +665,7 @@ class Parameter(QtCore.QObject):
self.sigTreeStateChanged.emit(self, changes)
class SignalBlocker:
class SignalBlocker(object):
def __init__(self, enterFn, exitFn):
self.enterFn = enterFn
self.exitFn = exitFn

View File

@ -260,7 +260,7 @@ def makeThreadsafe(obj):
raise Exception("Not sure how to make object of type %s thread-safe" % str(type(obj)))
class Locker:
class Locker(object):
def __init__(self, lock):
self.lock = lock
self.lock.acquire()

View File

@ -2,7 +2,7 @@ from pyqtgraph.Qt import QtGui, QtCore
__all__ = ['BusyCursor']
class BusyCursor:
class BusyCursor(object):
"""Class for displaying a busy mouse cursor during long operations.
Usage::

View File

@ -9,22 +9,25 @@ class ValueLabel(QtGui.QLabel):
"""
QLabel specifically for displaying numerical values.
Extends QLabel adding some extra functionality:
- displaying units with si prefix
- built-in exponential averaging
- displaying units with si prefix
- built-in exponential averaging
"""
def __init__(self, parent=None, suffix='', siPrefix=False, averageTime=0, formatStr=None):
"""
Arguments:
*suffix* (str or None) The suffix to place after the value
*siPrefix* (bool) Whether to add an SI prefix to the units and display a scaled value
*averageTime* (float) The length of time in seconds to average values. If this value
is 0, then no averaging is performed. As this value increases
the display value will appear to change more slowly and smoothly.
*formatStr* (str) Optionally, provide a format string to use when displaying text. The text will
be generated by calling formatStr.format(value=, avgValue=, suffix=)
(see Python documentation on str.format)
This option is not compatible with siPrefix
============ ==================================================================================
Arguments
suffix (str or None) The suffix to place after the value
siPrefix (bool) Whether to add an SI prefix to the units and display a scaled value
averageTime (float) The length of time in seconds to average values. If this value
is 0, then no averaging is performed. As this value increases
the display value will appear to change more slowly and smoothly.
formatStr (str) Optionally, provide a format string to use when displaying text. The text
will be generated by calling formatStr.format(value=, avgValue=, suffix=)
(see Python documentation on str.format)
This option is not compatible with siPrefix
============ ==================================================================================
"""
QtGui.QLabel.__init__(self, parent)
self.values = []
@ -67,4 +70,4 @@ class ValueLabel(QtGui.QLabel):
return pg.siFormat(avg, suffix=self.suffix)
else:
return self.formatStr.format(value=val, avgValue=avg, suffix=self.suffix)