@gen.engine
def List(args, callback):
 assert (len(args) <= 1)
 if (len(args) == 0):
  for b in store_utils.ListBuckets():
   print ('%s/' % b)
 else:
  pattern = args[0]
  res = store_utils.ParseFullPath(pattern)
  if (not res):
   logging.warning(('%s is not in a registered bucket' % pattern))
  else:
   (bucket, path) = res
   store = ObjectStore.GetInstance(bucket)
   if options.options.R:
    files = (yield gen.Task(store_utils.ListRecursively, store, path))
   else:
    (subdirs, files) = (yield gen.Task(store_utils.ListFilesAndDirs, store, path))
    for d in subdirs:
     print ('%s/%s' % (bucket, d))
   for d in files:
    print ('%s/%s' % (bucket, d))
 callback()

@ gen . engine def List ( args , callback ) : assert ( len ( args ) <= 1 ) if ( len ( args ) == 0 ) : for b in store_utils . ListBuckets ( ) : print ( '%s/' % b ) else : pattern = args [ 0 ] res = store_utils . ParseFullPath ( pattern ) if ( not res ) : logging . warning ( ( '%s is not in a registered bucket' % pattern ) ) else : ( bucket , path ) = res store = ObjectStore . GetInstance ( bucket ) if options . options . R : files = ( yield gen . Task ( store_utils . ListRecursively , store , path ) ) else : ( subdirs , files ) = ( yield gen . Task ( store_utils . ListFilesAndDirs , store , path ) ) for d in subdirs : print ( '%s/%s' % ( bucket , d ) ) for d in files : print ( '%s/%s' % ( bucket , d ) ) callback ( )
list buckets/files/directories .