~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to serve-branches

  • Committer: Jelmer Vernooij
  • Date: 2008-08-05 16:02:23 UTC
  • mto: (197.1.9 pathargs)
  • mto: This revision was merged to the branch mainline in revision 198.
  • Revision ID: jelmer@samba.org-20080805160223-xzti0kx7fd5ro5a1
Add manual page for serve-branches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
                      help="Serve user directories as ~user.")
41
41
    parser.add_option("--trunk-dir", metavar="DIR",
42
42
                      help="The directory that contains the trunk branches.")
43
 
    parser.add_option("--port", dest="user_port",
44
 
                      help="Port Loggerhead should listen on (defaults to 8080).")
45
 
    parser.add_option("--host", dest="user_host",
46
 
                      help="Host Loggerhead should listen on.")
47
 
    parser.add_option("--prefix", dest="user_prefix",
48
 
                      help="Specify host prefix.")
49
43
    parser.add_option("--version", action="store_true", dest="show_version",
50
44
                      help="Print the software version and exit")
51
45
    return parser
88
82
    app = HTTPExceptionHandler(app)
89
83
    app = TransLogger(app)
90
84
 
91
 
    if not options.user_prefix:
92
 
        prefix = '/'
93
 
    else:
94
 
        prefix = options.user_prefix
95
 
 
96
85
    try:
97
86
        from paste.deploy.config import PrefixMiddleware
98
87
    except ImportError:
99
88
        pass
100
89
    else:
101
 
        app = PrefixMiddleware(app, prefix=prefix)
102
 
    
103
 
    if not options.user_port:
104
 
        port = '8080'
105
 
    else:
106
 
        port = options.user_port
107
 
 
108
 
    if not options.user_host:
109
 
        host = '0.0.0.0'
110
 
    else:
111
 
        host = options.user_host
112
 
 
113
 
    httpserver.serve(app, host=host, port=port)
 
90
        app = PrefixMiddleware(app)
 
91
 
 
92
    httpserver.serve(app, host='0.0.0.0', port='8080')
114
93
 
115
94
 
116
95
if __name__ == "__main__":