view light8/dmxclient.py @ 161:0803fb42109d

we now have TkCueList, which is really cool. it doesn't provide editing we now have TkCueList, which is really cool. it doesn't provide editing yet, but you could almost nearly probably maybe run a show with it. heck, i hope so. some of the shifting/drawing problems were probably fixed. cuelist1 got more bogus data to help populate the TkCueList.
author dmcc
date Mon, 07 Jul 2003 17:18:26 +0000
parents 2dfe2c0ba052
children 79bc84310e80
line wrap: on
line source

""" module for clients to use for easy talking to the dmx
server. sending levels is now a simple call to
dmxclient.outputlevels(..)

client id is formed from sys.argv[0] and the PID.  """

import xmlrpclib,os,sys,socket,time
_dmx=None

_id="%s-%s" % (sys.argv[0].replace('.py','').replace('./',''),os.getpid())

def outputlevels(levellist):
    """present a list of dmx channel levels, each scaled from
    0..1. list can be any length- it will apply to the first len() dmx
    channels.

    if the server is not found, outputlevels will block for a
    second."""

    global _dmx,_id

    if _dmx is None:
        _dmx=xmlrpclib.Server("http://dash:8030")

    try:
        _dmx.outputlevels(_id,levellist)
    except socket.error,e:
        print "dmx server error %s, waiting"%e
        time.sleep(1)
    except xmlrpclib.Fault,e:
        print "outputlevels had xml fault: %s" % e
        time.sleep(1)