#NEWLINE# def extract_urls( self , text ) : #NEWLINE# #INDENT# block_parser = TextBlockParser ( ) #NEWLINE# soup = BeautifulSoup ( text ) #NEWLINE# urls = set ( ) #NEWLINE# url_list = [ ] #NEWLINE# for user_url in soup . findAll ( text = re . compile ( URL_RE ) ) : #NEWLINE# #INDENT# if ( not self . inside_a ( user_url ) ) : #NEWLINE# #INDENT# block_urls = block_parser . extract_urls ( unicode ( user_url ) ) #NEWLINE# for url in block_urls : #NEWLINE# #INDENT# if ( url not in urls ) : #NEWLINE# #INDENT# url_list . append ( url ) #NEWLINE# urls . add ( url ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return url_list