~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Matt Nordhoff
  • Date: 2009-05-13 14:30:32 UTC
  • Revision ID: mnordhoff@mattnordhoff.com-20090513143032-wv2sb6nxh4uedyff
NEWS for bug #375948

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
                import os.path, sys
72
72
                sys.path.append(os.path.dirname(__file__))
73
73
 
74
 
                from bzrlib.transport import get_transport
75
74
                from loggerhead.apps.transport import BranchesFromTransportRoot
76
 
                from loggerhead.config import LoggerheadConfig
77
75
                from paste.httpexceptions import HTTPExceptionHandler
78
76
                from paste.httpserver import serve
79
 
                path = kw.get('directory', '.')
 
77
                a = HTTPExceptionHandler(BranchesFromTransportRoot('.'))
80
78
                port = kw.get('port', DEFAULT_PORT)
81
79
                # port might be an int already...
82
80
                if isinstance(port, basestring) and ':' in port:
83
81
                    host, port = port.split(':')
84
82
                else:
85
83
                    host = '0.0.0.0'
86
 
                argv = ['--host', host, '--port', str(port), path]
87
 
                config = LoggerheadConfig(argv)
88
 
                transport = get_transport(path)
89
 
                app = BranchesFromTransportRoot(transport, config)
90
 
                app = HTTPExceptionHandler(app)
91
 
                serve(app, host=host, port=port)
 
84
                serve(a, host=host, port=port)
92
85
            else:
93
86
                super(cmd_serve, self).run(*args, **kw)
94
87