Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: boto/s3/bucketlistresultset.py

Issue 8386013: Merging in latest boto. (Closed) Base URL: svn://svn.chromium.org/boto
Patch Set: Redoing vendor drop by deleting and then merging. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « boto/s3/bucket.py ('k') | boto/s3/connection.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ 1 # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
2 # 2 #
3 # Permission is hereby granted, free of charge, to any person obtaining a 3 # Permission is hereby granted, free of charge, to any person obtaining a
4 # copy of this software and associated documentation files (the 4 # copy of this software and associated documentation files (the
5 # "Software"), to deal in the Software without restriction, including 5 # "Software"), to deal in the Software without restriction, including
6 # without limitation the rights to use, copy, modify, merge, publish, dis- 6 # without limitation the rights to use, copy, modify, merge, publish, dis-
7 # tribute, sublicense, and/or sell copies of the Software, and to permit 7 # tribute, sublicense, and/or sell copies of the Software, and to permit
8 # persons to whom the Software is furnished to do so, subject to the fol- 8 # persons to whom the Software is furnished to do so, subject to the fol-
9 # lowing conditions: 9 # lowing conditions:
10 # 10 #
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 def __init__(self, bucket=None, prefix='', delimiter='', marker='', headers= None): 46 def __init__(self, bucket=None, prefix='', delimiter='', marker='', headers= None):
47 self.bucket = bucket 47 self.bucket = bucket
48 self.prefix = prefix 48 self.prefix = prefix
49 self.delimiter = delimiter 49 self.delimiter = delimiter
50 self.marker = marker 50 self.marker = marker
51 self.headers = headers 51 self.headers = headers
52 52
53 def __iter__(self): 53 def __iter__(self):
54 return bucket_lister(self.bucket, prefix=self.prefix, 54 return bucket_lister(self.bucket, prefix=self.prefix,
55 delimiter=self.delimiter, marker=self.marker, heade rs=self.headers) 55 delimiter=self.delimiter, marker=self.marker,
56 headers=self.headers)
56 57
57 def versioned_bucket_lister(bucket, prefix='', delimiter='', 58 def versioned_bucket_lister(bucket, prefix='', delimiter='',
58 key_marker='', version_id_marker='', headers=None): 59 key_marker='', version_id_marker='', headers=None):
59 """ 60 """
60 A generator function for listing versions in a bucket. 61 A generator function for listing versions in a bucket.
61 """ 62 """
62 more_results = True 63 more_results = True
63 k = None 64 k = None
64 while more_results: 65 while more_results:
65 rs = bucket.get_all_versions(prefix=prefix, key_marker=key_marker, 66 rs = bucket.get_all_versions(prefix=prefix, key_marker=key_marker,
66 version_id_marker=version_id_marker, 67 version_id_marker=version_id_marker,
67 delimiter=delimiter, headers=headers) 68 delimiter=delimiter, headers=headers,
69 max_keys=999)
68 for k in rs: 70 for k in rs:
69 yield k 71 yield k
70 key_marker = rs.next_key_marker 72 key_marker = rs.next_key_marker
71 version_id_marker = rs.next_version_id_marker 73 version_id_marker = rs.next_version_id_marker
72 more_results= rs.is_truncated 74 more_results= rs.is_truncated
73 75
74 class VersionedBucketListResultSet: 76 class VersionedBucketListResultSet:
75 """ 77 """
76 A resultset for listing versions within a bucket. Uses the bucket_lister 78 A resultset for listing versions within a bucket. Uses the bucket_lister
77 generator function and implements the iterator interface. This 79 generator function and implements the iterator interface. This
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 self.upload_id_marker = upload_id_marker 132 self.upload_id_marker = upload_id_marker
131 self.headers = headers 133 self.headers = headers
132 134
133 def __iter__(self): 135 def __iter__(self):
134 return multipart_upload_lister(self.bucket, 136 return multipart_upload_lister(self.bucket,
135 key_marker=self.key_marker, 137 key_marker=self.key_marker,
136 upload_id_marker=self.upload_id_marker, 138 upload_id_marker=self.upload_id_marker,
137 headers=self.headers) 139 headers=self.headers)
138 140
139 141
OLDNEW
« no previous file with comments | « boto/s3/bucket.py ('k') | boto/s3/connection.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698