Define an HTTP-based VersionedStorage implementation.
libbe.command.serve : the associated server
VersionedStorage implementation over HTTP.
Uses GET to retrieve information and POST to set information.
Methods
add(id, *args, **kwargs) | Add an entry |
ancestors(*args, **kwargs) | Return a list of the specified entry’s ancestors’ ids. |
changed([revision]) | |
check_storage_version() | |
children(*args, **kwargs) | Return a list of specified entry’s children’s ids. |
commit(*args, **kwargs) | Commit the current repository, with a commit message string summary and body. |
connect() | Open a connection to the repository. |
destroy() | Remove the storage repository. |
disconnect() | Close the connection to the repository. |
exists(*args, **kwargs) | Check an entry’s existence |
get(*args, **kwargs) | Get contents of and entry as they were in a given revision. |
get_post_url(url[, get, data_dict, headers]) | |
init() | Create a new storage repository. |
is_readable() | |
is_writeable() | |
parse_repo(repo) | Grab username and password (if any) from the repo URL. |
recursive_remove(*args, **kwargs) | Remove an entry and all its decendents. |
remove(*args, **kwargs) | Remove an entry. |
revision_id([index]) | Return the name of the <index>th revision. |
set(id, value, *args, **kwargs) | Set the entry contents. |
storage_version([revision]) | |
version() | Return a version string for this backend. |
Grab username and password (if any) from the repo URL.
Examples
>>> s = HTTP('http://host.com/path/to/repo')
>>> s.repo
'http://host.com/path/to/repo'
>>> s.uname == None
True
>>> s.password == None
True
>>> s.parse_repo('http://joe:secret@host.com/path/to/repo')
('http://host.com/path/to/repo', 'joe', 'secret')
Return the name of the <index>th revision.
The choice of which branch to follow when crossing branches/merges is not defined. Revision indices start at 1; ID 0 is the blank repository.
Return None if index==None.
Raises : | InvalidRevision :
|
---|
Status returned to indicate exceptions on the server side.
A BE-specific extension to the HTTP/1.1 protocol (See RFC 2616).
Execute a GET or POST transaction.
Parameters : | url : str
get : bool
data_dict : dict
headers : list
|
---|