etwist/server.py
branchstable
changeset 4221 da84ca26896d
parent 4219 87203a0a3a81
child 4252 6c4f109c2b03
child 4398 4e7e74918631
--- a/etwist/server.py	Tue Jan 12 15:12:51 2010 +0100
+++ b/etwist/server.py	Tue Jan 12 17:24:46 2010 +0100
@@ -15,13 +15,12 @@
 from datetime import date, timedelta
 from urlparse import urlsplit, urlunsplit
 
-from twisted.application import strports
 from twisted.internet import reactor, task, threads
 from twisted.internet.defer import maybeDeferred
 from twisted.web2 import channel, http, server, iweb
 from twisted.web2 import static, resource, responsecode
 
-from cubicweb import ObjectNotFound, CW_EVENT_MANAGER
+from cubicweb import ConfigurationError, CW_EVENT_MANAGER
 from cubicweb.web import (AuthenticationError, NotFound, Redirect,
                           RemoteCallFailed, DirectResponse, StatusResponse,
                           ExplicitLogin)
@@ -296,7 +295,6 @@
             content = self.appli.need_login_content(req)
         return http.Response(code, req.headers_out, content)
 
-from twisted.python import failure
 from twisted.internet import defer
 from twisted.web2 import fileupload
 
@@ -388,8 +386,8 @@
     logger = getLogger('cubicweb.twisted')
     if not debug:
         if sys.platform == 'win32':
-            print "Under windows, you must use the service management commands (e.g : 'net start my_instance)'"
-            sys.exit(0)
+            raise ConfigurationError("Under windows, you must use the service management "
+                                     "commands (e.g : 'net start my_instance)'")
         print 'instance starting in the background'
         if daemonize():
             return # child process