~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to serve-branches.py

  • Committer: Robey Pointer
  • Date: 2006-12-29 21:51:12 UTC
  • Revision ID: robey@lag.net-20061229215112-d164jqo8djs3lims
add the script i use to update the website, so i don't lose it

Show diffs side-by-side

added added

removed removed

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