diff options
author | W. Trevor King <wking@drexel.edu> | 2010-01-01 14:43:03 -0500 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2010-01-01 14:43:03 -0500 |
commit | 5f26c407789a2f8fc51d89b6d0c590253b50c754 (patch) | |
tree | d28eea2fc972bdce77acddbcc9328ad316724f12 /libbe/storage/__init__.py | |
parent | d313d3651ae5875fda86491e693e1963d2de91a5 (diff) | |
download | bugseverywhere-5f26c407789a2f8fc51d89b6d0c590253b50c754.tar.gz |
Added libbe.command.serve and libbe.storage.http for HTTP backend.
Now the following works:
some-BE-dir$ ./be serve
$ ./be --repo http://localhost:8000 list
I haven't come up with a clean idea for testing this yet, so other
commands may be broken, but once we get the testing working, it
shouldn't be too hard to get everything working over HTTP :).
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, |