@gen.engine
def GetFileContents(store, path, callback, auto_gunzip=True):
 buf = (yield gen.Task(store.Get, path))
 if (auto_gunzip and path.endswith('.gz')):
  iobuffer = cStringIO.StringIO(buf)
  gzipIO = gzip.GzipFile('rb', fileobj=iobuffer)
  contents = gzipIO.read()
  iobuffer.close()
 else:
  contents = buf
 callback(contents)

@ gen . engine def GetFileContents ( store , path , callback , auto_gunzip = True ) : buf = ( yield gen . Task ( store . Get , path ) ) if ( auto_gunzip and path . endswith ( '.gz' ) ) : iobuffer = cStringIO . StringIO ( buf ) gzipIO = gzip . GzipFile ( 'rb' , fileobj = iobuffer ) contents = gzipIO . read ( ) iobuffer . close ( ) else : contents = buf callback ( contents )
get the contents of a file in s3 .