def __init__(self, handler, noStrip=NO_STRIP_ATTACHED): super(Animator, self).__init__(SOCKET_NAME, handler) self.queue = Queue.Queue(1) if noStrip: strip = Strip.SimulationStrip(STRIP_LENGTH, ROW_LENGTH) else: strip = Strip.HardwareStrip(STRIP_LENGTH) self.strip = strip self.counter = ModCounter(len(Animation.DYNAMIC_ANIMATIONS)) self.stepper = Stepper(self.queue, Animation.ANIMATIONS[Animation.BLACKOUT], strip) self.stepper.start() if GPIO_AVAILABLE: self.buttonmonitor = ButtonMonitor() self.buttonmonitor.start() self.processCommand(ButtonEvent.SINGLEPRESS)
import cProfile import Strip s = Strip.HardwareStrip(64, "/dev/spidev0.0") cProfile.run("s.setColor([127,127,127])")