~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: xaav at xaav
  • Date: 2011-07-10 22:51:56 UTC
  • mto: (459.2.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 461.
  • Revision ID: xaav@xaav.tk-20110710225156-xtt237a7njqwti2p
Fixed buggy merging.

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
            sys.path.append(os.path.dirname(__file__))
63
63
 
64
64
    def serve_http(transport, host=None, port=None, inet=None):
 
65
        # TODO: if we supported inet to pass requests in and respond to them,
 
66
        #       then it would be easier to test the full stack, but it probably
 
67
        #       means routing around paste.httpserver.serve which probably
 
68
        #       isn't testing the full stack
65
69
        from paste.httpexceptions import HTTPExceptionHandler
66
70
        from paste.httpserver import serve
67
71
 
68
72
        _ensure_loggerhead_path()
69
73
 
 
74
        from loggerhead.apps.http_head import HeadMiddleware
70
75
        from loggerhead.apps.transport import BranchesFromTransportRoot
71
76
        from loggerhead.config import LoggerheadConfig
72
77
        from loggerhead.main import setup_logging
81
86
        config = LoggerheadConfig(argv)
82
87
        setup_logging(config, init_logging=False, log_file=sys.stderr)
83
88
        app = BranchesFromTransportRoot(transport.base, config)
 
89
        # Bug #758618, HeadMiddleware seems to break HTTPExceptionHandler from
 
90
        # actually sending appropriate return codes to the client. Since nobody
 
91
        # desperately needs HeadMiddleware right now, just ignoring it.
 
92
        # app = HeadMiddleware(app)
84
93
        app = HTTPExceptionHandler(app)
85
94
        serve(app, host=host, port=port)
86
95