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.
source code
 
_set_credentials(self, client) source code
 
shutdown(self)
Shutdown the subversion storage.
source code
object
create_container(self, collection_name)
Creates a subdirectory within the the svn working copy If it already exists does nothing.
source code
StorageResourceInfo or subclass
info(self, collection_name, resource_name=None)
Returns a StorageResourceInfo which ``key`` attribute is set to the absolute path to the given resource or, if not provided, to the collection directory.
source code
object
get_content(self, info)
Returns the content as a string of the resource found at 'info'.
source code
string
get_meta_data(self, info)
Returns the content as a string of the meta data found at 'info'.
source code
 
put_content(self, info, content, media_type=None, *args, **kwargs)
Set the content at 'info' of the resource.
source code
 
put_meta_data(self, info, content, media_type=None, **kwargs)
Set the content at 'info' of the resource.
source code
 
remove_content(self, info)
Remove the resource at 'info'
source code
 
remove_meta_data(self, info)
Remove the resource at 'info'
source code
 
persist(self, path_list, msg=None)
Finalize the svn checkin
source code
bool
exists(self, info)
Returns True if the resource at 'info.key' exists.
source code
dict
ls(self, collection_name, ext=None)
List all the resources in a collection
source code
tuple
ils(self, collection_name, ext=None)
List all the resources in a collection
source code

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__

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
Returns: object
the subclass may or may not return an object upon the creation of the container
Overrides: Storage.create_container

info(self, collection_name, resource_name=None)

source code 
Returns a StorageResourceInfo which ``key`` attribute is set to the absolute path to the given resource or, if not provided, to the collection directory.
Returns: StorageResourceInfo or subclass
an object representing the resource within the storage
Overrides: Storage.info

get_content(self, info)

source code 

Returns the content as a string of the resource found at 'info'. If no resource could be found, amplee.error.UnknownResourcean is raised.

Keyword arguments info -- as returned by info()
Returns: object
content of the resource
Overrides: Storage.get_content

get_meta_data(self, info)

source code 

Returns the content as a string of the meta data found at 'info'. If no resource could be found, amplee.error.UnknownResourcean is raised.

Keyword arguments info -- as returned by info()
Returns: string
content of the atom entry
Overrides: Storage.get_meta_data

put_content(self, info, content, media_type=None, *args, **kwargs)

source code 

Set the content at 'info' of the resource.

Keyword arguments info -- as returned by info()

content -- data as a string object or file object. In that case content MUST return the full content as a byte string on the read() call

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, info, content, media_type=None, **kwargs)

source code 

Set the content at 'info' of the resource.

Keyword arguments info -- as returned by info()

content -- data as a string object or file object. In that case content MUST return the full content as a byte string on the read() call

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, info)

source code 

Remove the resource at 'info'

Keyword arguments info -- as returned by info()
Overrides: Storage.remove_content

remove_meta_data(self, info)

source code 

Remove the resource at 'info'

Keyword arguments info -- as returned by info()
Overrides: Storage.remove_meta_data

persist(self, path_list, msg=None)

source code 

Finalize the svn checkin

Keyword arguments path_list -- list of infos as returned by info() to checkin msg -- string message to provide for the checking It defaults to a simple 'Persist'
Overrides: Storage.persist

exists(self, info)

source code 

Returns True if the resource at 'info.key' exists. False otherwise.

Keyword arguments info -- as returned by info()
Returns: bool
True if the test succeeds, False otherwise.
Overrides: Storage.exists

ls(self, collection_name, ext=None)

source code 

List all the resources in a collection

Keyword arguments collection_name -- name of the directory in the working copy
Returns: dict
a dictionnary of existing members, their identifier and a StorageResourceInfo instance representing the resource.
Overrides: Storage.ls

ils(self, collection_name, ext=None)

source code 

List all the resources in a collection

Keyword arguments collection_name -- name of the directory in the working copy
Returns: tuple
existing members, their identifier and a StorageResourceInfo instance representing the resource.
Overrides: Storage.ils