def __init__(self, args): EventGen.__init__(self) self.buf = bytearray() self._writing = False self._closed = False self.retval = None try: self.p = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=False) except Exception, e: self._closed = True self.retval = 3 self._event('close', e)
def __init__(self, conn, addr, db): EventGen.__init__(self) self.conn = conn self.addr = addr self.db = db self.pubchans = set() self.subchans = set() self.idents = set() self.delay = False self.rand = struct.pack('<I', random.randint(2**31,2**32-1)) self.fu = FeedUnpack() conn._on('read', self.io_in) conn._on('close', self.closed) self.sendinfo()
def __init__(self, conn, addr, db): EventGen.__init__(self) self.conn = conn self.addr = addr self.db = db self.pubchans = set() self.subchans = set() self.idents = set() self.delay = False self.rand = struct.pack('<I', random.randint(2**31, 2**32 - 1)) self.fu = FeedUnpack() conn._on('read', self.io_in) conn._on('close', self.closed) self.sendinfo()