scripts/interactive.py
changeset 2056 bbd16a156bde
parent 2046 1fb1c628ad60
child 2702 028f6adffde7
equal deleted inserted replaced
2055:b4375ec63de5 2056:bbd16a156bde
    33 
    33 
    34 import code
    34 import code
    35 import getpass
    35 import getpass
    36 import os
    36 import os
    37 import sys
    37 import sys
    38 import sys
       
    39 
    38 
    40 
    39 
    41 def auth_func():
    40 def auth_func():
    42   """Returns a tuple with username and password.
    41   """Returns a tuple with username and password.
    43   """
    42   """
    54     batchSize: how many entities to retrieve in one datastore call
    53     batchSize: how many entities to retrieve in one datastore call
    55 
    54 
    56   Retrieved from http://tinyurl.com/d887ll (AppEngine cookbook).
    55   Retrieved from http://tinyurl.com/d887ll (AppEngine cookbook).
    57   """
    56   """
    58 
    57 
       
    58   from google.appengine.ext import db
       
    59 
    59    # AppEngine will not fetch more than 1000 results
    60    # AppEngine will not fetch more than 1000 results
    60   batchSize = min(batchSize,1000)
    61   batchSize = min(batchSize,1000)
    61 
    62 
    62   query = None
    63   query = None
    63   done = False
    64   done = False
    65 
    66 
    66   if key:
    67   if key:
    67     key = db.Key(key)
    68     key = db.Key(key)
    68 
    69 
    69   while not done:
    70   while not done:
       
    71     print count
    70     query = queryGen()
    72     query = queryGen()
    71     if key:
    73     if key:
    72       query.filter("__key__ > ",key)
    74       query.filter("__key__ > ",key)
    73     results = query.fetch(batchSize)
    75     results = query.fetch(batchSize)
    74     for result in results:
    76     for result in results: