def test(): clearscreen.clear() client.write(0, 0, "Hello World!") x = 0 y = 1 for c in sorted(FONT.keys()): client.blit(x * client.PWIDTH, y * client.PHEIGHT, client.PWIDTH, client.PHEIGHT, client.char_to_pixel_segment(c)) x += 1 if (x > 15): x = 0 y += 1
def test(): clearscreen.clear() client.write(0,0,"Hello World!") x = 0 y = 1 for c in sorted(FONT.keys()): client.blit(x*client.PWIDTH, y*client.PHEIGHT, client.PWIDTH, client.PHEIGHT, client.char_to_pixel_segment(c)) x += 1 if(x > 15): x = 0 y += 1
def filter_time(talks): for talk in talks: p = datetime.datetime.strptime(talk["date"][0:-6],"%Y-%m-%dT%H:%M:%S") if p > datetime.datetime.now(): return talk while True: d = datetime.datetime.now() t = d.strftime(" %H:%M:%S") if tick > 10: j = urllib2.urlopen('https://events.ccc.de/congress/2014/Fahrplan/schedule.json') schedule = json.load(j) tick = 0 if schedule: client.write(0,0,greeting) client.write(client.NUM_SEG_X - len(t), 0, t); client.write(0,1,"Fahrplan Version:" + schedule['schedule']['version']) saale = ["Saal 1", 'Saal 2', "Saal G", "Saal 6"] talks = OrderedDict() for saal in saale: talks[saal] = schedule['schedule']['conference']['days'][0]['rooms'][saal] i = 3 f_talk = OrderedDict() for saal in talks: f_talk[saal] = filter_time(talks[saal]) for saal in f_talk: client.write(0,i,'{} => {} : {}'.format(saal,f_talk[saal]['start'].encode('utf-8').strip(), f_talk[saal]["title"].encode('utf-8').strip())) i = i + 1 client.write(0,8," USE MORE BANDWIDTH!")
greeting = "Stratum 0 Mensadisplay" tick = 0 j = urllib2.urlopen( 'https://events.ccc.de/congress/2014/Fahrplan/schedule.json') schedule = json.load(j) while True: t = datetime.datetime.now().strftime(" %H:%M:%S") if tick > 10: j = urllib2.urlopen( 'https://events.ccc.de/congress/2014/Fahrplan/schedule.json') schedule = json.load(j) tick = 0 client.write(0, 0, greeting) client.write(client.NUM_SEG_X - len(t), 0, t) client.write(0, 1, "Fahrplan Version:" + schedule['schedule']['version']) saal1_talk = schedule['schedule']['conference']['days'][0]['rooms'][ 'Saal 1'][0] saal2_talk = schedule['schedule']['conference']['days'][0]['rooms'][ 'Saal 2'][0] saalG_talk = schedule['schedule']['conference']['days'][0]['rooms'][ 'Saal G'][0] saal6_talk = schedule['schedule']['conference']['days'][0]['rooms'][ 'Saal 6'][0] client.write( 0, 2, "Saal 1 => " + saal1_talk['start'] + " : " + saal1_talk['title']) client.write( 0, 3, "Saal 2 => " + saal2_talk['start'] + " : " + saal2_talk['title']) client.write(
#!/usr/bin/env python import datetime import time import client while True: t = datetime.datetime.now().strftime(" %H:%M:%S") client.write(client.NUM_SEG_X - len(t), 0, t) time.sleep(1)
import urllib2 import json greeting = "Stratum 0 Mensadisplay" tick = 0 j = urllib2.urlopen('https://events.ccc.de/congress/2014/Fahrplan/schedule.json') schedule = json.load(j) while True: t = datetime.datetime.now().strftime(" %H:%M:%S") if tick > 10: j = urllib2.urlopen('https://events.ccc.de/congress/2014/Fahrplan/schedule.json') schedule = json.load(j) tick = 0 client.write(0,0,greeting) client.write(client.NUM_SEG_X - len(t), 0, t); client.write(0,1,"Fahrplan Version:" + schedule['schedule']['version']) saal1_talk = schedule['schedule']['conference']['days'][0]['rooms']['Saal 1'][0] saal2_talk = schedule['schedule']['conference']['days'][0]['rooms']['Saal 2'][0] saalG_talk = schedule['schedule']['conference']['days'][0]['rooms']['Saal G'][0] saal6_talk = schedule['schedule']['conference']['days'][0]['rooms']['Saal 6'][0] client.write(0,2,"Saal 1 => " + saal1_talk['start'] + " : " + saal1_talk['title']) client.write(0,3,"Saal 2 => " + saal2_talk['start'] + " : " + saal2_talk['title']) client.write(0,4,"Saal G => " + saalG_talk['start'] + " : " + saalG_talk['title']) client.write(0,5,"Saal 6 => " + saal6_talk['start'] + " : " + saal6_talk['title']) client.write(0,7,"==> Get your brand new Easterhegg 2015 T-Shirt here! <==") time.sleep(0.5) tick += 1
#!/usr/bin/env python import datetime import time import client while True: t = datetime.datetime.now().strftime(" %H:%M:%S") client.write(client.NUM_SEG_X - len(t), 0, t); time.sleep(1)
def hack(): client.write("play") return "Playing!"