~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to serve-branches

  • Committer: Guillermo Gonzalez
  • Date: 2008-09-09 04:06:13 UTC
  • mfrom: (219 trunk)
  • mto: (217.1.9 logging)
  • mto: This revision was merged to the branch mainline in revision 226.
  • Revision ID: guillo.gonzo@gmail.com-20080909040613-vuu54qaowgwz4cot
 merge with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
                      help="Serve user directories as ~user.")
42
42
    parser.add_option("--trunk-dir", metavar="DIR",
43
43
                      help="The directory that contains the trunk branches.")
 
44
    parser.add_option("--port", dest="user_port",
 
45
                      help="Port Loggerhead should listen on (defaults to 8080).")
 
46
    parser.add_option("--host", dest="user_host",
 
47
                      help="Host Loggerhead should listen on.")
 
48
    parser.add_option("--prefix", dest="user_prefix",
 
49
                      help="Specify host prefix.")
44
50
    parser.add_option("--version", action="store_true", dest="show_version",
45
51
                      help="Print the software version and exit")
46
52
    parser.add_option('--log-folder', dest="log_folder", 
100
106
    app = TransLogger(app, logger=logger)
101
107
 
102
108
 
 
109
    if not options.user_prefix:
 
110
        prefix = '/'
 
111
    else:
 
112
        prefix = options.user_prefix
 
113
 
103
114
    try:
104
115
        from paste.deploy.config import PrefixMiddleware
105
116
    except ImportError:
106
117
        pass
107
118
    else:
108
 
        app = PrefixMiddleware(app)
109
 
 
110
 
    httpserver.serve(app, host='0.0.0.0', port='8080')
 
119
        app = PrefixMiddleware(app, prefix=prefix)
 
120
    
 
121
    if not options.user_port:
 
122
        port = '8080'
 
123
    else:
 
124
        port = options.user_port
 
125
 
 
126
    if not options.user_host:
 
127
        host = '0.0.0.0'
 
128
    else:
 
129
        host = options.user_host
 
130
 
 
131
    httpserver.serve(app, host=host, port=port)
111
132
 
112
133
 
113
134
if __name__ == "__main__":