Access to the root directory or any other non-leaf directory raises a IOError
[jelmer/calypso.git] / calypso.py
index 75788b4f99cd24a776dc3b59c3cd72a35c76aafa..78baa91d0433c466dab167be661b9c4257f2a1c5 100755 (executable)
@@ -37,7 +37,7 @@ arguments.
 # TODO: Manage smart and configurable logs
 
 import daemon
-from daemon import pidlockfile
+import lockfile
 import logging
 import optparse
 import os
@@ -132,6 +132,9 @@ if options.import_dest:
 def run_server():
     try:
         # Launch server
+        log.debug("Starting HTTP%s server on %s:%d" % ("S" if options.ssl else "",
+                                                       options.host if options.host else "*",
+                                                       options.port))
         server_class = calypso.HTTPSServer if options.ssl else calypso.HTTPServer
         server = server_class(
             (options.host, options.port), calypso.CollectionHTTPHandler)
@@ -148,6 +151,7 @@ if not options.daemon:
 context = daemon.DaemonContext()
 context.umask = 0o002
 if options.pidfile:
+    from lockfile import pidlockfile
     # Generate a pidfile where requested
     context.pidfile = pidlockfile.PIDLockFile(options.pidfile)
 with context: