@gen.engine
def ListAllCommonPrefixes(store, delimiter, callback, prefix=None, marker=None):
 prefixes = set()
 keys = []
 while True:
  (new_prefixes, new_keys) = (yield gen.Task(store.ListCommonPrefixes, delimiter, prefix=prefix, marker=marker, maxkeys=1000))
  prefixes = prefixes.union(set(new_prefixes))
  keys.extend(new_keys)
  if ((len(new_prefixes) + len(new_keys)) < 1000):
   break
  marker = ''
  if (len(new_prefixes) > 0):
   marker = max(marker, new_prefixes[(-1)])
  if (len(new_keys) > 0):
   marker = max(marker, new_keys[(-1)])
 callback((sorted(list(prefixes)), keys))

@ gen . engine def ListAllCommonPrefixes ( store , delimiter , callback , prefix = None , marker = None ) : prefixes = set ( ) keys = [ ] while True : ( new_prefixes , new_keys ) = ( yield gen . Task ( store . ListCommonPrefixes , delimiter , prefix = prefix , marker = marker , maxkeys = 1000 ) ) prefixes = prefixes . union ( set ( new_prefixes ) ) keys . extend ( new_keys ) if ( ( len ( new_prefixes ) + len ( new_keys ) ) < 1000 ) : break marker = '' if ( len ( new_prefixes ) > 0 ) : marker = max ( marker , new_prefixes [ ( - 1 ) ] ) if ( len ( new_keys ) > 0 ) : marker = max ( marker , new_keys [ ( - 1 ) ] ) callback ( ( sorted ( list ( prefixes ) ) , keys ) )
list all common prefixes .