def readURLFileLike(urlFileLike):
 encoding = urlFileLike.info().get('Content-Encoding')
 if (encoding in ('gzip', 'x-gzip', 'deflate')):
  content = urlFileLike.read()
  if (encoding == 'deflate'):
   data = StringIO.StringIO(zlib.decompress(content))
  else:
   data = gzip.GzipFile('', 'rb', 9, StringIO.StringIO(content))
  result = data.read()
 else:
  result = urlFileLike.read()
 urlFileLike.close()
 return result

def readURLFileLike ( urlFileLike ) : encoding = urlFileLike . info ( ) . get ( 'Content-Encoding' ) if ( encoding in ( 'gzip' , 'x-gzip' , 'deflate' ) ) : content = urlFileLike . read ( ) if ( encoding == 'deflate' ) : data = StringIO . StringIO ( zlib . decompress ( content ) ) else : data = gzip . GzipFile ( '' , 'rb' , 9 , StringIO . StringIO ( content ) ) result = data . read ( ) else : result = urlFileLike . read ( ) urlFileLike . close ( ) return result
return the contents of the file like objects as string .