(self, msg)
Iterate through the response and replace values
Iterate through the response and replace values
Iterate through the response and replace values
def handle_response(self, msg):
        """ Iterate through the response and replace values
        """
        for match in self.rep_regex:
            msg.replace(match, self.rep_regex[match])
       
        # modify the DOM
        try:
            for tag in self.rep_tags.keys():
                tmp = {}
                tmp[tag] = self.rep_tags[tag]
                parser = HTMLHooker(tmp)
                parser.feed(msg.get_decoded_content())
                for entry in parser.data.keys():
                    for data_entry in parser.data[entry]:
                        rep_entry = self.rep_tags[tag][entry]
                        msg.replace(data_entry, rep_entry)
        except Exception, e:
            util.debug(e) 
        msg.reply()
def handle_response ( self , msg ) : for match in self . rep_regex : msg . replace ( match , self . rep_regex [ match ] ) # modify the DOM try : for tag in self . rep_tags . keys ( ) : tmp = { } tmp [ tag ] = self . rep_tags [ tag ] parser = HTMLHooker ( tmp ) parser . feed ( msg . get_decoded_content ( ) ) for entry in parser . data . keys ( ) : for data_entry in parser . data [ entry ] : rep_entry = self . rep_tags [ tag ] [ entry ] msg . replace ( data_entry , rep_entry ) except Exception , e : util . debug ( e ) msg . reply ( )