~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: John Arbash Meinel
  • Date: 2011-03-16 12:21:36 UTC
  • mfrom: (411.3.3 simple_mainline)
  • Revision ID: john@arbash-meinel.com-20110316122136-930ttoriqgbw2cy3
Include simple_mainline.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
starts a web server to browse the contents of a branch.
31
31
"""
32
32
 
33
 
import sys
34
 
 
35
33
from info import (
36
34
    bzr_plugin_version as version_info,
37
35
    bzr_compatible_versions,
62
60
            sys.path.append(os.path.dirname(__file__))
63
61
 
64
62
    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
69
63
        from paste.httpexceptions import HTTPExceptionHandler
70
64
        from paste.httpserver import serve
71
65
 
72
66
        _ensure_loggerhead_path()
73
67
 
74
 
        from loggerhead.apps.http_head import HeadMiddleware
75
68
        from loggerhead.apps.transport import BranchesFromTransportRoot
76
69
        from loggerhead.config import LoggerheadConfig
77
70
        from loggerhead.main import setup_logging
86
79
        config = LoggerheadConfig(argv)
87
80
        setup_logging(config, init_logging=False, log_file=sys.stderr)
88
81
        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)
93
82
        app = HTTPExceptionHandler(app)
94
83
        serve(app, host=host, port=port)
95
84