# # Get list of remote files # import urllib2 from sgmllib import SGMLParser from Base import * class URLHelper(SGMLParser): def reset(self): SGMLParser.reset(self) self.urls = [] def start_a(self,attrs): href = [v for k, v in attrs if k=='href'] if href: self.urls.extend(href) import re def urlFiles(path,dirs=0): reason = Reason() filenames = [] verbo.log('http','About to open url directory ['+path+']...') try: path2 = re.sub('(?0 and not ( url[0]=='/' or contains(url,'?') or contains(url,'=') ): if url[-1]=='/': if dirs: filenames.append(url) else: filenames.append(url) return reason,filenames