~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to serve-branches

  • Committer: Martin Albisetti
  • Date: 2008-08-20 18:54:51 UTC
  • mto: This revision was merged to the branch mainline in revision 218.
  • Revision ID: argentina@gmail.com-20080820185451-1qppr2yvcsyomvty
 * Allow specifying a custom port
 * Allow specifying a custom host

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
    parser.add_option("--trunk-dir", metavar="DIR",
42
42
                      help="The directory that contains the trunk branches.")
43
43
    parser.add_option("--port", dest="user_port",
44
 
                      help="Port Loggerhead should listen on (defaults to 8080).")
 
44
                      help="Port Loggerhead should listen on. 8080 is the default one.")
45
45
    parser.add_option("--host", dest="user_host",
46
46
                      help="Host Loggerhead should listen on.")
47
 
    parser.add_option("--prefix", dest="user_prefix",
48
 
                      help="Specify host prefix.")
49
47
    parser.add_option("--version", action="store_true", dest="show_version",
50
48
                      help="Print the software version and exit")
51
49
    return parser
88
86
    app = HTTPExceptionHandler(app)
89
87
    app = TransLogger(app)
90
88
 
91
 
    if not options.user_prefix:
92
 
        prefix = '/'
93
 
    else:
94
 
        prefix = options.user_prefix
95
 
 
96
89
    try:
97
90
        from paste.deploy.config import PrefixMiddleware
98
91
    except ImportError:
99
92
        pass
100
93
    else:
101
 
        app = PrefixMiddleware(app, prefix=prefix)
 
94
        app = PrefixMiddleware(app)
102
95
    
103
96
    if not options.user_port:
104
97
        port = '8080'