Rename bathSize variable to batch_size in soc.logic.models.base module.
authorPawel Solyga <Pawel.Solyga@gmail.com>
Wed, 27 May 2009 03:31:27 +0200
changeset 2364 a1cbd3143277
parent 2363 9046c80a9137
child 2365 a66e1dd8ced7
Rename bathSize variable to batch_size in soc.logic.models.base module.
app/soc/logic/models/base.py
--- a/app/soc/logic/models/base.py	Wed May 27 03:22:37 2009 +0200
+++ b/app/soc/logic/models/base.py	Wed May 27 03:31:27 2009 +0200
@@ -515,8 +515,8 @@
       offset = offset + chunk
 
     return result
-
-  def entityIterator(self, queryGen, batchSize = 100):
+  # pylint: disable-msg=C0103
+  def entityIterator(self, queryGen, batch_size = 100):
     """Iterator that yields an entity in batches.
 
     Args:
@@ -527,7 +527,7 @@
     """
 
      # AppEngine will not fetch more than 1000 results
-    batchSize = min(batchSize,1000)
+    batch_size = min(batch_size, 1000)
 
     done = False
     count = 0
@@ -536,12 +536,12 @@
     while not done:
       query = queryGen()
       if key:
-        query.filter("__key__ > ",key)
-      results = query.fetch(batchSize)
+        query.filter("__key__ > ", key)
+      results = query.fetch(batch_size)
       for result in results:
         count += 1
         yield result
-      if batchSize > len(results):
+      if batch_size > len(results):
         done = True
       else:
         key = results[-1].key()