libbe.util.subproc.invoke(self.notify, stdin=message, shell=True)
-class Serve_Commands (libbe.util.wsgi.ServerCommand):
+class ServeCommands (libbe.util.wsgi.ServerCommand):
"""Serve commands over HTTP.
This allows you to run local `be` commands interfacing with remote
# alias for libbe.command.base.get_command_class()
-Serve_commands = Serve_Commands
+Serve_commands = ServeCommands
if libbe.TESTING:
libbe.util.subproc.invoke(self.notify, stdin=message, shell=True)
-class Serve (libbe.util.wsgi.ServerCommand):
+class ServeStorage (libbe.util.wsgi.ServerCommand):
"""Serve bug directory storage over HTTP.
This allows you to run local `be` commands interfacing with remote
:class:`ServerApp`.
"""
- name = 'serve'
+ name = 'serve-storage'
def _get_app(self, logger, storage, **kwargs):
return ServerApp(
return """
Example usage::
- $ be serve
+ $ be serve-storage
And in another terminal (or after backgrounding the server)::
"""
+# alias for libbe.command.base.get_command_class()
+Serve_storage = ServeStorage
+
+
if libbe.TESTING:
class ServerAppTestCase (libbe.util.wsgi.WSGITestCase):
def setUp(self):
See Also
--------
-:mod:`libbe.command.serve` : the associated server
+:mod:`libbe.command.serve_storage` : the associated server
"""
from __future__ import absolute_import
import unittest
import libbe.bugdir
- import libbe.command.serve
+ import libbe.command.serve_storage
import libbe.util.http
import libbe.util.wsgi
name = 'TestingHTTP'
def __init__(self, repo, *args, **kwargs):
self._storage_backend = base.VersionedStorage(repo)
- app = libbe.command.serve.ServerApp(
+ app = libbe.command.serve_storage.ServerApp(
storage=self._storage_backend)
self.app = libbe.util.wsgi.BEExceptionApp(app=app)
HTTP.__init__(self, repo='http://localhost:8000/', *args, **kwargs)
self.intitialized = False
- # duplicated from libbe.command.serve.WSGITestCase
+ # duplicated from libbe.util.wsgi.WSGITestCase
self.default_environ = {
'REQUEST_METHOD': 'GET', # 'POST', 'HEAD'
'REMOTE_ADDR': '192.168.0.123',
}
def getURL(self, app, path='/', method='GET', data=None,
scheme='http', environ={}):
- # duplicated from libbe.command.serve.WSGITestCase
+ # duplicated from libbe.util.wsgi.WSGITestCase
env = copy.copy(self.default_environ)
env['PATH_INFO'] = path
env['REQUEST_METHOD'] = method