diff options
author | W. Trevor King <wking@drexel.edu> | 2010-01-01 16:54:30 -0500 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2010-01-01 16:54:30 -0500 |
commit | 97eabcc3657bdc6511baebd79b059ae1589c7e87 (patch) | |
tree | 32b896bed9ea94c5fda2e2a68345916dd8c5cea7 /libbe/storage/__init__.py | |
parent | 4d4283ecd654f1efb058cd7f7dba6be88b70ee92 (diff) | |
parent | 286c686cb50eb8240fa9b15365d61783279b86a2 (diff) | |
download | bugseverywhere-97eabcc3657bdc6511baebd79b059ae1589c7e87.tar.gz |
Merged be.html-storage
Added HTTP storage backend and server
Serve a local repo on http://localhost:8000
be --repo REPO serve
Then connect from other be calls, for example
be --repo http://localhost:8000 list
Diffstat (limited to 'libbe/storage/__init__.py')
-rw-r--r-- | libbe/storage/__init__.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/libbe/storage/__init__.py b/libbe/storage/__init__.py index 7abe791..b6b0ac1 100644 --- a/libbe/storage/__init__.py +++ b/libbe/storage/__init__.py @@ -36,15 +36,24 @@ STORAGE_VERSIONS = ['Bugs Everywhere Tree 1 0', # the current version STORAGE_VERSION = STORAGE_VERSIONS[-1] -def get_storage(location): - """ - Return a Storage instance from a repo location string. - """ +def get_http_storage(location): + import http + return http.HTTP(location) + +def get_vcs_storage(location): import vcs s = vcs.detect_vcs(location) s.repo = location return s +def get_storage(location): + """ + Return a Storage instance from a repo location string. + """ + if location.startswith('http://'): + return get_http_storage(location) + return get_vcs_storage(location) + __all__ = [ConnectionError, InvalidStorageVersion, InvalidID, InvalidRevision, InvalidDirectory, NotWriteable, NotReadable, EmptyCommit, STORAGE_VERSIONS, STORAGE_VERSION, |