Package amplee :: Package storage :: Module storezodb :: Class ZODBStorage
[hide private]
[frames] | no frames]

Class ZODBStorage

source code

object --+
         |
        ZODBStorage

Instance Methods [hide private]
  __init__(self, db, name, reuse=True)
ZODB Storage for amplee.
  shutdown(self)
Shutdown the ZODB storage.
  path(self, *args, **kwargs)
Returns the full path as a string of the resource as an instance of ZODBFSPath.
  get_content(self, path)
Returns the content as a string of the resource found at 'path'.
  get_meta_data(self, path)
Returns the content as a string of the resource found at 'path'.
  put_content(self, path, content, **kwargs)
Set the content at 'path' of the resource.
  put_meta_data(self, path, content, **kwargs)
Set the content at 'path' of the resource.
  remove_content(self, path)
...
  remove_meta_data(self, path)
...
  persist(self, *args, **kwargs)
...
  exists(self, path)
Returns True if the resource at 'path' exists.
  ls(self, collection_name, ext)
List resources with the provided extension in a collection Returns a dictionary like this: members[basename(abs_path)] = {'path': abs_path} Keyword arguments collection_name -- name of the node in the ZODB database containing all the members of a collection.

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__


Properties [hide private]

Inherited from object: __class__


Method Details [hide private]

__init__(self, db, name, reuse=True)
(Constructor)

source code 

ZODB Storage for amplee.

Keyword argument
db -- a ZODB database (FileStorage for instance)
name -- name of the top level node for this storage
reuse -- if True and the 'name' already exists then
it will not overwrite the existing one.

Overrides: object.__init__

shutdown(self)

source code 

Shutdown the ZODB storage.
Does nothing effectively.

path(self, *args, **kwargs)

source code 

Returns the full path as a string of the resource
as an instance of ZODBFSPath.

get_content(self, path)

source code 

Returns the content as a string of the resource found at 'path'.
If no resource could be found, an IOError is raised.

Keyword arguments
path -- Path to the resource as returned by get_path

get_meta_data(self, path)

source code 

Returns the content as a string of the resource found at 'path'.
If no resource could be found, an IOError is raised.

Keyword arguments
path -- Path to the resource as returned by get_path

put_content(self, path, content, **kwargs)

source code 

Set the content at 'path' of the resource.

Keyword arguments
path -- Path to the resource as returned by get_path
content -- data as a string object

put_meta_data(self, path, content, **kwargs)

source code 

Set the content at 'path' of the resource.

Keyword arguments
path -- Path to the resource as returned by get_path
content -- data as a string object

remove_content(self, path)

source code 

Remove the resource at 'path'

Keyword arguments
path -- Path to the resource as returned by get_path

remove_meta_data(self, path)

source code 

Remove the resource at 'path'

Keyword arguments
path -- Path to the resource as returned by get_path

persist(self, *args, **kwargs)

source code 

Does nothing in the ZODB storage

exists(self, path)

source code 

Returns True if the resource at 'path' exists. False otherwise.

Keyword arguments
path -- Path to the resource as returned by get_path

ls(self, collection_name, ext)

source code 

List resources with the provided extension in a collection
Returns a dictionary like this:

members[basename(abs_path)] = {'path': abs_path}

Keyword arguments
collection_name -- name of the node in the ZODB database
containing all the members of a collection. Created if it does
not exists.
ext -- extension of resources to return