Database Reference
In-Depth Information
print '%s last modified at %d' % (
table['id'], last_modified)
return (last_modified, row_count)
def advance(self, rows, page_token):
'''Called after reading a page, advances current
indices.'''
done = page_token is None
if self.rows_left is not None:
self.rows_left -= len(rows)
if self.rows_left < 0: print 'Error: Read too
many rows!'
if self.rows_left <= 0: done = True
if self.next_index is not None:
self.next_index += len(rows)
else:
# Only use page tokens when we're not using
# index-based pagination.
self.next_page_token = page_token
return done
def get_table_id(self):
if '@' in self.table_id and self.snapshot_time is
not None:
raise Exception("Table already has a snapshot
time")
if self.snapshot_time is None:
return self.table_id
else:
return '%s@%d' % (self.table_id,
self.snapshot_time)
def make_read_message(self, row_count, max_results):
'''Creates a status message for the current read
operation.'''
read_msg = 'Read %d rows' % (row_count,)
Search WWH ::




Custom Search