(self, paste)
return found
Gets the supplied paste url.

        Returns list of tuples of matches in paste.
Gets the supplied paste url.
Gets the supplied paste url .
def get_paste(self, paste):
        """
        Gets the supplied paste url.

        Returns list of tuples of matches in paste.
        """
        req = requests.get(paste.url, headers=self.headers)
        LOGGER.debug('Got response for paste')
        while req.status_code != 200:
            LOGGER.error('Response was not 200. Trying again...')
            req = requests.get(paste.url)
        found = []
        for name, pattern in self.target_patterns:
            LOGGER.debug('Trying pattern: %s', pattern)
            matches = re.findall(pattern, req.text)
            LOGGER.debug('Got %d matches', len(matches))
            if matches:
                found.append((name, len(matches)))
        return found
def get_paste ( self , paste ) : req = requests . get ( paste . url , headers = self . headers ) LOGGER . debug ( 'Got response for paste' ) while req . status_code != 200 : LOGGER . error ( 'Response was not 200. Trying again...' ) req = requests . get ( paste . url ) found = [ ] for name , pattern in self . target_patterns : LOGGER . debug ( 'Trying pattern: %s' , pattern ) matches = re . findall ( pattern , req . text ) LOGGER . debug ( 'Got %d matches' , len ( matches ) ) if matches : found . append ( ( name , len ( matches ) ) ) return found