예제 #1
0
파일: x3plugin.py 프로젝트: koendc/ExtreMon
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)
예제 #2
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)