~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:29:36 UTC
  • Revision ID: john@arbash-meinel.com-20110316122936-u1u98hqpwyv08ry9
Import sys at the start of loggerhead/__init__.py we use it as part of startup.
And sys is always loaded, no need to avoid importing it.

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
69
65
        from paste.httpexceptions import HTTPExceptionHandler
70
66
        from paste.httpserver import serve
71
67
 
72
68
        _ensure_loggerhead_path()
73
69
 
74
 
        from loggerhead.apps.http_head import HeadMiddleware
75
70
        from loggerhead.apps.transport import BranchesFromTransportRoot
76
71
        from loggerhead.config import LoggerheadConfig
77
72
        from loggerhead.main import setup_logging
86
81
        config = LoggerheadConfig(argv)
87
82
        setup_logging(config, init_logging=False, log_file=sys.stderr)
88
83
        app = BranchesFromTransportRoot(transport.base, config)
89
 
        app = HeadMiddleware(app)
90
84
        app = HTTPExceptionHandler(app)
91
85
        serve(app, host=host, port=port)
92
86