def __init__(self, host=None): if host is not None: self.host = host else: self.host = "localhost" self.guiDisplay = GraphicsDisplay() self.subscriptions = [] for characterIndex, guiCharacter in enumerate( self.guiDisplay.characters): for segmentIndex in range(16): self.subscriptions.append( marshallSegmentTopic(characterIndex, segmentIndex))
for pos in range(0, len(lines), 2): await scheduleLines(display, lines[pos], lines[pos + 1], color) async def schedulePangrams(display): for mode in [ 0 ]: # range(2): # previously went through upper, mixed and lower case for pangram in examples: if mode == 0: pangram = pangram.upper() elif mode == 1: pangram = pangram else: pangram = pangram.lower() await scheduleMessage(display, pangram) display.clear() await sleep(defaultOffDelay) def run(display): async def render(): return await schedulePangrams(display) forever(render) if __name__ == "__main__": from display.gui import GraphicsDisplay run(GraphicsDisplay())
from timing import * from color import * from display.gui import GraphicsDisplay import pysher import pusher # Add a logging handler so we can see the raw communication data import logging import sys import urllib.request, json display = GraphicsDisplay() root = logging.getLogger() root.setLevel(logging.INFO) ch = logging.StreamHandler(sys.stdout) root.addHandler(ch) pusher_receiver = pysher.Pusher('334a34862786c44de127', cluster='eu', secret='b7220b4992a3f1b0ca0f') pusher_sender = pusher.Pusher(app_id='586349', key='334a34862786c44de127', secret='b7220b4992a3f1b0ca0f', cluster='eu') aPhrases = ["ready", "for", "data"] iPhrase = 0