(self, secs)
Make script sleep for some amount of time.
Make script sleep for some amount of time.
Make script sleep for some amount of time .
def sleep(self, secs):
        """Make script sleep for some amount of time."""
        fdlist = []
        for dbname in self._listen_map.keys():
            if dbname not in self.db_cache:
                continue
            fd = self.db_cache[dbname].fileno()
            if fd is None:
                continue
            fdlist.append(fd)

        if not fdlist:
            return BaseScript.sleep(self, secs)

        try:
            if hasattr(select, 'poll'):
                p = select.poll()
                for fd in fdlist:
                    p.register(fd, select.POLLIN)
                p.poll(int(secs * 1000))
            else:
                select.select(fdlist, [], [], secs)
        except select.error, d:
            self.log.info('wait canceled')
def sleep ( self , secs ) : fdlist = [ ] for dbname in self . _listen_map . keys ( ) : if dbname not in self . db_cache : continue fd = self . db_cache [ dbname ] . fileno ( ) if fd is None : continue fdlist . append ( fd ) if not fdlist : return BaseScript . sleep ( self , secs ) try : if hasattr ( select , 'poll' ) : p = select . poll ( ) for fd in fdlist : p . register ( fd , select . POLLIN ) p . poll ( int ( secs * 1000 ) ) else : select . select ( fdlist , [ ] , [ ] , secs ) except select . error , d : self . log . info ( 'wait canceled' )