Package amplee :: Package storage :: Module storesvn :: Class SubversionStorage
[hide private]
[frames] | no frames]

Class SubversionStorage

source code

object --+    
         |    
   Storage --+
             |
            SubversionStorage

Instance Methods [hide private]
  __init__(self, repository_uri, working_copy_path, username=None, password=None)
Subversion storage for amplee.
  _set_credentials(self, client)
  shutdown(self)
Shutdown the subversion storage.
  create_container(self, collection_name)
Creates a subdirectory within the the svn working copy If it already exists does nothing.
  path(self, *args, **kwargs)
Returns the full path as a string of the resource to the working copy.
  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 meta data found at 'path'.
  put_content(self, path, content, media_type=None, *args, **kwargs)
Set the content at 'path' of the resource.
  put_meta_data(self, path, content, media_type=None, *args, **kwargs)
Set the content at 'path' of the resource.
  remove_content(self, path)
...
  remove_meta_data(self, path)
...
  persist(self, path_list, msg=None)
...
  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 directory in the working copy 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, repository_uri, working_copy_path, username=None, password=None)
(Constructor)

source code 

Subversion storage for amplee.

If the working copy does not exist, the storage will automatically check the
repository out.

Keyword arguments
repository_uri -- URI of the subversion repository. It can be a local or remote URL.
working_copy_path -- absoulte path to the local working copy
username -- if needed by the repository
password -- if needed by the repository

Overrides: object.__init__

_set_credentials(self, client)

source code 
None

shutdown(self)

source code 

Shutdown the subversion storage.
Does nothing effectively.

Overrides: Storage.shutdown

create_container(self, collection_name)

source code 

Creates a subdirectory within the the svn working copy
If it already exists does nothing. The newly created
directory is immediatly checked in.

Keyword argument
collection_name -- name of the directory to create

Overrides: Storage.create_container

path(self, *args, **kwargs)

source code 

Returns the full path as a string of the resource to the working copy.

Overrides: Storage.path

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

Overrides: Storage.get_content

get_meta_data(self, path)

source code 

Returns the content as a string of the meta data 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

Overrides: Storage.get_meta_data

put_content(self, path, content, media_type=None, *args, **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
media_type -- if provided, mime type of the resource as a string object
It uses the svn:mime_type property

Overrides: Storage.put_content

put_meta_data(self, path, content, media_type=None, *args, **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
media_type -- if provided, mime type of the resource as a string object
It uses the svn:mime_type property

Overrides: Storage.put_meta_data

remove_content(self, path)

source code 

Remove the resource at 'path'

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

Overrides: Storage.remove_content

remove_meta_data(self, path)

source code 

Remove the resource at 'path'

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

Overrides: Storage.remove_meta_data

persist(self, path_list, msg=None)

source code 

Finalize the svn checkin

Keyword arguments
path_list -- list of paths as returned by get_path to
checkin
msg -- string message to provide for the checking
It defaults to a simple 'Persist'

Overrides: Storage.persist

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

Overrides: Storage.exists

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 directory in the working copy
containing all the members of a collection. Created if it does
not exists.
ext -- extension of resources to return

Overrides: Storage.ls