# HG changeset patch # User drewp # Date 2004-06-15 02:06:36 # Node ID 70d45c584776254dae86b9b5118ddd61759ae3e1 # Parent e16b8ca470d8af66255b339474fbfe701b9f5bfc minor old changes diff --git a/light8/dmxserver.py b/light8/dmxserver.py --- a/light8/dmxserver.py +++ b/light8/dmxserver.py @@ -26,7 +26,7 @@ from __future__ import division from twisted.internet import reactor from twisted.web import xmlrpc, server import sys,time -from optik import OptionParser +from optparse import OptionParser from io import ParportDMX from updatefreq import Updatefreq @@ -63,21 +63,23 @@ class XMLRPCServe(xmlrpc.XMLRPC): def purgeclients(self): - """forget about any clients who haven't sent levels in a while - (5 seconds). this runs in a loop""" + """forget about any clients who haven't sent levels in a while. + this runs in a loop""" purge_age=10 # seconds reactor.callLater(1,self.purgeclients) now=time.time() - for cid,lastseen in self.lastseen.items(): + cids=self.clientlevels.keys() + for cid in cids: + lastseen=self.lastseen[cid] if lastseen