view light8/potserver.py @ 102:e04f7b552bcd

- scroll wheel works everywhere - scroll wheel works everywhere - interface is white on black - subs that start scenes are white - more status information, startup process kinda cleaned up
author dmcc
date Sun, 14 Jul 2002 08:01:24 +0000
parents 7f273883de60
children d8e2492e2947
line wrap: on
line source

#!/usr/bin/python

import socket,time

from io import *

pots = SerialPots()
pots.golive()

laste=""
while 1:
    
    l=pots.getlevels()
        
    try:
        s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        s.setblocking(1)
        ret=s.connect_ex(("dash", socket.getservbyname('rlslider','tcp')))
#        print ret        
        s.send("%d %d %d %d\n" % l)
        s.close()
    except Exception,e:
        print str(e)
        s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        if ret==111:
            print time.ctime(),"waiting for server"
            time.sleep(3)
        else:
            print time.ctime(),"connected"