<s> def bucket_lister ( bucket , prefix = '<STR_LIT>' , delimiter = '<STR_LIT>' , marker = '<STR_LIT>' , headers = None ) : <EOL> """<STR_LIT>""" <EOL> more_results = True <EOL> k = None <EOL> while more_results : <EOL> rs = bucket . get_all_keys ( prefix = prefix , marker = marker , <EOL> delimiter = delimiter , headers = headers ) <EOL> for k in rs : <EOL> yield k <EOL> if k : <EOL> marker = rs . next_marker or k . name <EOL> more_results = rs . is_truncated <EOL> class BucketListResultSet : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , bucket = None , prefix = '<STR_LIT>' , delimiter = '<STR_LIT>' , marker = '<STR_LIT>' , headers = None ) : <EOL> self . bucket = bucket <EOL> self . prefix = prefix <EOL> self . delimiter = delimiter <EOL> self . marker = marker <EOL> self . headers = headers <EOL> def __iter__ ( self ) : <EOL> return bucket_lister ( self . bucket , prefix = self . prefix , <EOL> delimiter = self . delimiter , marker = self . marker , <EOL> headers = self . headers ) <EOL> def versioned_bucket_lister ( bucket , prefix = '<STR_LIT>' , delimiter = '<STR_LIT>' , <EOL> key_marker = '<STR_LIT>' , version_id_marker = '<STR_LIT>' , headers = None ) : <EOL> """<STR_LIT>""" <EOL> more_results = True <EOL> k = None <EOL> while more_results : <EOL> rs = bucket . get_all_versions ( prefix = prefix , key_marker = key_marker , <EOL> version_id_marker = version_id_marker , <EOL> delimiter = delimiter , headers = headers , <EOL> max_keys = <NUM_LIT> ) <EOL> for k in rs : <EOL> yield k <EOL> key_marker = rs . next_key_marker <EOL> version_id_marker = rs . next_version_id_marker <EOL> more_results = rs . is_truncated <EOL> class VersionedBucketListResultSet : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , bucket = None , prefix = '<STR_LIT>' , delimiter = '<STR_LIT>' , key_marker = '<STR_LIT>' , <EOL> version_id_marker = '<STR_LIT>' , headers = None ) : <EOL> self . bucket = bucket <EOL> self . prefix = prefix <EOL> self . delimiter = delimiter <EOL> self . key_marker = key_marker <EOL> self . version_id_marker = version_id_marker <EOL> self . headers = headers <EOL> def __iter__ ( self ) : <EOL> return versioned_bucket_lister ( self . bucket , prefix = self . prefix , <EOL> delimiter = self . delimiter , <EOL> key_marker = self . key_marker , <EOL> version_id_marker = self . version_id_marker , <EOL> headers = self . headers ) <EOL> def multipart_upload_lister ( bucket , key_marker = '<STR_LIT>' , <EOL> upload_id_marker = '<STR_LIT>' , <EOL> headers = None ) : <EOL> """<STR_LIT>""" <EOL> more_results = True <EOL> k = None <EOL> while more_results : <EOL> rs = bucket . get_all_multipart_uploads ( key_marker = key_marker , <EOL> upload_id_marker = upload_id_marker , <EOL> headers = headers ) <EOL> for k in rs : <EOL> yield k <EOL> key_marker = rs . next_key_marker <EOL> upload_id_marker = rs . next_upload_id_marker <EOL> more_results = rs . is_truncated <EOL> class MultiPartUploadListResultSet : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , bucket = None , key_marker = '<STR_LIT>' , <EOL> upload_id_marker = '<STR_LIT>' , headers = None ) : <EOL> self . bucket = bucket <EOL> self . key_marker = key_marker <EOL> self . upload_id_marker = upload_id_marker <EOL> self . headers = headers <EOL> def __iter__ ( self ) : <EOL> return multipart_upload_lister ( self . bucket , <EOL> key_marker = self . key_marker , <EOL> upload_id_marker = self . upload_id_marker , <EOL> headers = self . headers ) </s>
