File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed
Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change 2323if len (sys .argv ) > 2 :
2424 prefix = sys .argv [2 ]
2525
26- # create a dictionary to contain object names
27- object_dict = {}
28- object_dict [bucket ]= []
29-
3026# get_bucket returns max 1000 objects -- use pagination to get more
3127getMore = True
3228marker = None
4137 getMore = resp .result ["IsTruncated" ] == 'true'
4238 marker = resp .result ["NextMarker" ]
4339
44- # extract what is wanted from get_bucket response; key is object name
45- objectNames = [bucket ['Key' ] for bucket in resp .result ['ContentsList' ]]
46- for name in objectNames :
47- object_dict [bucket ].append (name )
40+ # extract and print what is wanted from get_bucket response; key is object name
41+ for contents in resp .result ["ContentsList" ]:
42+ print (contents ['Key' ])
4843
49- # print object list in JSON
50- print (object_dict )
You can’t perform that action at this time.
0 commit comments