# HG changeset patch # User darius@Inchoate # Date 1232190839 -37800 # Node ID a472d6eab97e910414884f42041a7ee07185111f # Parent ac60a9244bdf76e3e4355631ee8db090e68afd54 Play back the last 5 lines to newly connected clients rather than 1. diff -r ac60a9244bdf -r a472d6eab97e zbmux.py --- a/zbmux.py Sat Jan 17 14:42:51 2009 +1030 +++ b/zbmux.py Sat Jan 17 21:43:59 2009 +1030 @@ -53,8 +53,8 @@ self.terminal.resetPrivateModes([]) # Send the last whole line we've seen out - if self.factory.lastline != None: - self.message(self.factory.lastline) + for l in self.factory.lastlines: + self.message(l + '\n') self.pending = "" self.pendtimer = None @@ -99,7 +99,7 @@ self.zbid = zbid self.clients = [] self.tmpline = "" - self.lastline = None + self.lastlines = [] # Open logger self.logger = logging.getLogger('Zigbee-%d' % (zbid)) @@ -123,7 +123,8 @@ self.tmpline = self.tmpline + message tmp = self.tmpline.split('\n') for l in tmp[0:-1]: - self.lastline = l # Stores last seen line for new clients + self.lastlines.append(l) + self.lastlines = self.lastlines[-5:] self.logger.debug(l.replace('\n', '')) self.tmpline = tmp[-1]