App Engine Python SDK  v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
Public Member Functions | Static Public Attributes | List of all members
google.appengine.api.datastore_file_stub.DatastoreFileStub Class Reference
Inheritance diagram for google.appengine.api.datastore_file_stub.DatastoreFileStub:
google.appengine.api.apiproxy_stub.APIProxyStub

Public Member Functions

def __init__
 
def Clear
 
def Read
 
def Write
 
def MakeSyncCall
 
def assertPbIsInitialized
 
- Public Member Functions inherited from google.appengine.api.apiproxy_stub.APIProxyStub
def __init__
 
def CreateRPC
 
def MakeSyncCall
 
def SetError
 

Static Public Attributes

tuple READ_PB_EXCEPTIONS
 
tuple READ_ERROR_MSG
 
tuple READ_PY250_MSG
 
- Static Public Attributes inherited from google.appengine.api.apiproxy_stub.APIProxyStub
 THREADSAFE = False
 

Additional Inherited Members

- Public Attributes inherited from google.appengine.api.apiproxy_stub.APIProxyStub
 request_data
 

Detailed Description

Persistent stub for the Python datastore API.

Stores all entities in memory, and persists them to a file as pickled
protocol buffers. A DatastoreFileStub instance handles a single app's data
and is backed by files on disk.

Constructor & Destructor Documentation

def google.appengine.api.datastore_file_stub.DatastoreFileStub.__init__ (   self,
  app_id,
  datastore_file,
  history_file = None,
  require_indexes = False,
  service_name = 'datastore_v3',
  trusted = False,
  consistency_policy = None,
  save_changes = True,
  root_path = None,
  use_atexit = True,
  auto_id_policy = datastore_stub_util.SEQUENTIAL 
)
Constructor.

Initializes and loads the datastore from the backing files, if they exist.

Args:
  app_id: string
  datastore_file: string, stores all entities across sessions.  Use None
  not to use a file.
  history_file: DEPRECATED. No-op.
  require_indexes: bool, default False.  If True, composite indexes must
  exist in index.yaml for queries that need them.
  service_name: Service name expected for all calls.
  trusted: bool, default False.  If True, this stub allows an app to
access the data of another app.
  consistency_policy: The consistency policy to use or None to use the
default. Consistency policies can be found in
datastore_stub_util.*ConsistencyPolicy
  save_changes: bool, default True. If this stub should modify
datastore_file when entities are changed.
  root_path: string, the root path of the app.
  use_atexit: bool, indicates if the stub should save itself atexit.
  auto_id_policy: enum, datastore_stub_util.SEQUENTIAL or .SCATTERED

Member Function Documentation

def google.appengine.api.datastore_file_stub.DatastoreFileStub.assertPbIsInitialized (   self,
  pb 
)
Raises an exception if the given PB is not initialized and valid.
def google.appengine.api.datastore_file_stub.DatastoreFileStub.Clear (   self)
Clears the datastore by deleting all currently stored entities and
queries. 
def google.appengine.api.datastore_file_stub.DatastoreFileStub.MakeSyncCall (   self,
  service,
  call,
  request,
  response,
  request_id = None 
)
The main RPC entry point. service must be 'datastore_v3'.
def google.appengine.api.datastore_file_stub.DatastoreFileStub.Read (   self)
Reads the datastore and history files into memory.

The in-memory query history is cleared, but the datastore is *not*
cleared; the entities in the files are merged into the entities in memory.
If you want them to overwrite the in-memory datastore, call Clear() before
calling Read().

If the datastore file contains an entity with the same app name, kind, and
key as an entity already in the datastore, the entity from the file
overwrites the entity in the datastore.

Also sets each ID counter to one greater than the highest ID allocated so
far in that counter's ID space.
def google.appengine.api.datastore_file_stub.DatastoreFileStub.Write (   self)
Writes out the datastore and history files.

Be careful! If the files already exist, this method overwrites them!

Member Data Documentation

tuple google.appengine.api.datastore_file_stub.DatastoreFileStub.READ_ERROR_MSG
static
Initial value:
1 = ('Data in %s is corrupt or a different version. '
2  'Try running with the --clear_datastore flag.\n%r')
tuple google.appengine.api.datastore_file_stub.DatastoreFileStub.READ_PB_EXCEPTIONS
static
Initial value:
1 = (ProtocolBuffer.ProtocolBufferDecodeError, LookupError,
2  TypeError, ValueError)
tuple google.appengine.api.datastore_file_stub.DatastoreFileStub.READ_PY250_MSG
static
Initial value:
1 = ('Are you using FloatProperty and/or GeoPtProperty? '
2  'Unfortunately loading float values from the datastore '
3  'file does not work with Python 2.5.0. '
4  'Please upgrade to a newer Python 2.5 release or use '
5  'the --clear_datastore flag.\n')

The documentation for this class was generated from the following file: