Define an HTTP-based VersionedStorage implementation.

See Also

libbe.command.serve : the associated server

class, *args, **kwargs)

VersionedStorage implementation over HTTP.

Uses GET to retrieve information and POST to set information.


add(id, *args, **kwargs) Add an entry
ancestors(*args, **kwargs) Return a list of the specified entry’s ancestors’ ids.
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.
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.
version() Return a version string for this backend.
get_post_url(url, get=True, data_dict=None, headers=[])
name = 'HTTP'

Grab username and password (if any) from the repo URL.


>>> s = HTTP('')
>>> s.repo
>>> s.uname == None
>>> s.password == None
>>> s.parse_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 :

If the specified revision does not exist.

storage_version(revision=None) = 418

Status returned to indicate exceptions on the server side.

A BE-specific extension to the HTTP/1.1 protocol (See RFC 2616).

exception, url=None, msg=None), get=True, data_dict=None, headers=[])

Execute a GET or POST transaction.

Parameters :

url : str

The base URL (query portion added internally, if necessary).

get : bool

Use GET if True, otherwise use POST.

data_dict : dict

Data to send, either by URL query (if GET) or by POST (if POST).

headers : list

Extra HTTP headers to add to the request.

Table Of Contents

This Page