class X3Out(X3Log,X3Conf): def __init__(self,max_shuttle_size=512,max_shuttle_age=.5): X3Log.__init__(self) X3Conf.__init__(self) self.loom=Loom(launcher=self.launch,max_shuttle_size=max_shuttle_size, max_shuttle_age=max_shuttle_age) self.loom.start() def put(self,label,value): self.loom.put(label,value) def launch(self,shuttle): try: sys.stdout.write(shuttle) sys.stdout.flush() except IOError: self.log("IOError writing to stdout.. exiting") sys.exit(0)
class X3Out(X3Log, X3Conf): def __init__(self, max_shuttle_size=512, max_shuttle_age=.5): X3Log.__init__(self) X3Conf.__init__(self) self.loom = Loom(launcher=self.launch, max_shuttle_size=max_shuttle_size, max_shuttle_age=max_shuttle_age) self.loom.start() def put(self, label, value): self.loom.put(label, value) def launch(self, shuttle): try: sys.stdout.write(shuttle) sys.stdout.flush() except IOError: self.log("IOError writing to stdout.. exiting") sys.exit(0)