camlogger.warning('Received the order to die from %r with id = %d', agent, id) if __name__ == "__main__": config = SafeConfigParser() config.read('conf/twitterbot.ini') camlogger.setLevel(level=getattr(logging,config.get('Camera','log_level'))) CAMURL = config.get('Camera','camurl') CAMTIME = int(config.get('Camera','countdown')) ivy_name = config.get('Camera','ivy_name') IvyInit(ivy_name,'[%s is ready]'%ivy_name,0,oncxproc,ondieproc) IvyStart(config.get('General','ivy_bus')) IvyBindMsg(status_change,'^status=(-?[0-1])') IvyBindMsg(heartbeat,'^hb_syn') IvySendMsg('status?') led.port.msh = 12000000 led.initDisplay() while True: t = datetime.now() if t.second%10 < 5: # show time #print 'Time %02d:%02d:%02d'%(t.hour,t.minute,t.second) led.sendNum(t.hour*100+t.minute,low_dot=True,high_dot=True) else: # show date #print 'Date %04d-%02d-%02d'%(t.year,t.month,t.day) led.sendNum(t.month*100+t.day,low_dot=True,high_dot=False) sleep(1)