(self, dbname, channel)
Make connection listen for specific event channel.

        Listening will be activated on next .get_database() call.

        Basically this means that DBScript.sleep() will poll for events
        on that db connection, so when event appears, script will be
        woken up.
Make connection listen for specific event channel.
Make connection listen for specific event channel .
def listen(self, dbname, channel):
        """Make connection listen for specific event channel.

        Listening will be activated on next .get_database() call.

        Basically this means that DBScript.sleep() will poll for events
        on that db connection, so when event appears, script will be
        woken up.
        """
        if dbname not in self._listen_map:
            self._listen_map[dbname] = []
        clist = self._listen_map[dbname]
        if channel not in clist:
            clist.append(channel)
def listen ( self , dbname , channel ) : if dbname not in self . _listen_map : self . _listen_map [ dbname ] = [ ] clist = self . _listen_map [ dbname ] if channel not in clist : clist . append ( channel )