def make_safe_filename_from_url(self, url):
        '''return a version of url safe for use as a filename'''
        r = re.compile("([^a-zA-Z0-9_.-])")
        filename = r.sub(lambda m : "%" + str(hex(ord(str(m.group(1))))).upper(), url)
        return filename
def make_safe_filename_from_url ( self , url ) : r = re . compile ( "([^a-zA-Z0-9_.-])" ) filename = r . sub ( lambda m : "%" + str ( hex ( ord ( str ( m . group ( 1 ) ) ) ) ) . upper ( ) , url ) return filename
return a version of url safe for use as a filename