Skip to content

Instantly share code, notes, and snippets.

@cpascual
cpascual / pgtaurus.py
Last active March 10, 2017 12:52
Proof of concept for plotting a taurus attribute with pyqtgraph
import sys
import numpy
from taurus.external.qt import QtGui
from taurus.qt.qtgui.application import TaurusApplication
from taurus.qt.qtgui.base import TaurusBaseComponent
from pyqtgraph import PlotDataItem
class TaurusPlotDataItem(PlotDataItem, TaurusBaseComponent):
"""A taurus-ified PlotDataItem"""
#find trunks
find . -type d -iname trunk > /tmp/find-trunk.txt &
#filter paths
cat /tmp/find-trunk.txt | sed 's/\.\(.*\)\/trunk/\1/' > /tmp/paths.tst
# to make script
# sed 's/\.\(.*\)\/trunk/grep -v \1 \| \\/' > /tmp/filter.sh
# edit /tmp/filter.sh
import h5py
import numpy
import time
import sys
from multiprocessing import Process
FNAME = 'foo.h5'
from PyQt4 import Qt
class Signaller(Qt.QObject):
signal = Qt.pyqtSignal()
class Base(object):
"""Base is not a QObject but provides a pyqtSignal signal member via
a Signaller hidden behind a property"""
@cpascual
cpascual / signalmethodwrapper.py
Created April 28, 2016 12:41
Wrapper to work around signal and method conflicts
class SignalMethodWrapper(object):
"""Object that can act simultaneously as a pyqtBoundSignal and as a callable
method.
It optionally allows to log deprecation messages whe used as a signal
or as a method or both
"""
def __init__(self, pyqtboundsignal, method, alt_sig=None, alt_meth=None,
name='<wrapper>'):