~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to serve-branches.py

  • Committer: Martin Albisetti
  • Date: 2008-06-20 18:04:33 UTC
  • mto: (157.1.3 loggerhead)
  • mto: This revision was merged to the branch mainline in revision 187.
  • Revision ID: argentina@gmail.com-20080620180433-y5cw7g6lsk5h28x3
Adapt to WSGI

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python
2
 
import logging
3
 
import sys
4
 
 
 
1
from loggerhead.apps.filesystem import BranchesFromFileSystemRoot
5
2
from paste import httpserver
6
 
from paste.httpexceptions import HTTPExceptionHandler
7
 
from paste.translogger import TransLogger
8
 
 
9
 
from loggerhead.apps.filesystem import BranchesFromFileSystemRoot
10
 
 
11
 
 
12
 
logging.basicConfig()
13
 
logging.getLogger().setLevel(logging.DEBUG)
14
 
 
15
 
if len(sys.argv) > 1:
16
 
    path = sys.argv[1]
17
 
else:
18
 
    path = '.'
19
 
 
20
 
app = BranchesFromFileSystemRoot(path)
21
 
 
22
 
app = HTTPExceptionHandler(app)
23
 
app = TransLogger(app)
24
 
 
25
 
try:
26
 
    from paste.deploy.config import PrefixMiddleware
27
 
except ImportError:
28
 
    pass
29
 
else:
30
 
    app = PrefixMiddleware(app)
 
3
from paste.httpexceptions import make_middleware
 
4
from paste.translogger import make_filter
 
5
 
 
6
app = BranchesFromFileSystemRoot('.')
 
7
 
 
8
app = app
 
9
app = make_middleware(app)
 
10
app = make_filter(app, None)
31
11
 
32
12
#from paste.evalexception import EvalException
33
13
#app = EvalException(app)
34
14
 
35
 
httpserver.serve(app, host='0.0.0.0', port='8080')
 
15
httpserver.serve(app, host='0.0.0.0', port='9876')