[boto] r1319 committed - Added a StopIteration to SelectResultSet for the case of max_items bei...

10 views
Skip to first unread message

codesite...@google.com

unread,
Oct 7, 2009, 5:22:43 PM10/7/09
to boto-...@googlegroups.com
Revision: 1319
Author: mumrah
Date: Wed Oct 7 14:22:18 2009
Log: Added a StopIteration to SelectResultSet for the case of max_items
being less
than the number of items returned by the first page of results.

http://code.google.com/p/boto/source/detail?r=1319

Modified:
/trunk/boto/sdb/queryresultset.py

=======================================
--- /trunk/boto/sdb/queryresultset.py Wed Sep 23 15:39:59 2009
+++ /trunk/boto/sdb/queryresultset.py Wed Oct 7 14:22:18 2009
@@ -79,6 +79,8 @@
rs = self.domain.connection.select(self.domain, self.query,
next_token=self.next_token)
for item in rs:
+ if self.max_items and num_results >= self.max_items:
+ raise StopIteration
yield item
num_results += 1
self.next_token = rs.next_token

Reply all
Reply to author
Forward
0 new messages