Use libbe.util.http.HTTP_USER_ERROR everywhere instead of hardcoding 418
[be.git] / libbe / command / serve_storage.py
index 57bea20f32c31533306c785995d7a2351cff8184..086cb84c00868949aa9077f98f03a996ba6957de 100644 (file)
@@ -29,6 +29,7 @@ import os.path
 import libbe
 import libbe.command
 import libbe.command.util
+import libbe.util.http
 import libbe.util.subproc
 import libbe.util.wsgi
 import libbe.version
@@ -91,7 +92,6 @@ class ServerApp (libbe.util.wsgi.WSGI_AppObject,
             **kwargs)
         self.storage = storage
         self.notify = notify
-        self.http_user_error = 418
 
     # handlers
     def add(self, environ, start_response):
@@ -203,7 +203,7 @@ class ServerApp (libbe.util.wsgi.WSGI_AppObject,
             revision = self.storage.commit(summary, body, allow_empty)
         except libbe.storage.EmptyCommit, e:
             raise libbe.util.wsgi.HandlerError(
-                self.http_user_error, 'EmptyCommit')
+                libbe.util.http.HTTP_USER_ERROR, 'EmptyCommit')
         if self.notify:
             self._notify(environ, 'commit', id,
                          [('allow_empty', allow_empty), ('summary', summary),
@@ -307,8 +307,7 @@ And in another terminal (or after backgrounding the server)::
 If you bind your server to a public interface, take a look at the
 ``--read-only`` option or the combined ``--ssl --auth FILE``
 options so other people can't mess with your repository.  If you do use
-authentication, you'll need to send in your username and password with,
-for example::
+authentication, you'll need to send in your username and password::
 
     $ be --repo http://username:password@localhost:8000/ list
 """