~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to serve-branches

  • Committer: Michael Hudson
  • Date: 2009-03-02 06:10:32 UTC
  • Revision ID: michael.hudson@canonical.com-20090302061032-tw61av5ljg2ikbjc
make pygments optional

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
from optparse import OptionParser
23
23
 
 
24
from bzrlib.plugin import load_plugins
 
25
 
24
26
from paste import httpserver
25
27
from paste.httpexceptions import HTTPExceptionHandler, HTTPInternalServerError
26
28
from paste.translogger import TransLogger
125
127
        prefix = '/'
126
128
    else:
127
129
        prefix = options.user_prefix
 
130
        if not prefix.startswith('/'):
 
131
            prefix = '/' + prefix
128
132
 
129
133
    try:
130
134
        from paste.deploy.config import PrefixMiddleware
144
148
    else:
145
149
        app = PrefixMiddleware(app, prefix=prefix)
146
150
 
 
151
    app = HTTPExceptionHandler(app)
147
152
    app = ErrorHandlerApp(app)
148
 
    app = HTTPExceptionHandler(app)
149
153
 
150
154
    if not options.user_port:
151
155
        port = '8080'
157
161
    else:
158
162
        host = options.user_host
159
163
 
 
164
    load_plugins()
 
165
 
160
166
    httpserver.serve(app, host=host, port=port)
161
167
 
162
168