~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to serve-branches

  • Committer: Guillermo Gonzalez
  • Date: 2008-09-10 23:12:59 UTC
  • mfrom: (221 trunk)
  • mto: (217.1.9 logging)
  • mto: This revision was merged to the branch mainline in revision 226.
  • Revision ID: guillo.gonzo@gmail.com-20080910231259-4wnfmu30f4n90w6x
 * merge with trunk (resolve conflicts in NEWS and serve-branches)

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
from loggerhead import __version__
29
29
from loggerhead.apps.filesystem import (
30
30
    BranchesFromFileSystemRoot, UserBranchesFromFileSystemRoot)
 
31
from loggerhead.util import Reloader
31
32
from loggerhead.apps.error import ErrorHandlerApp
32
33
 
 
34
 
33
35
def command_line_parser():
34
36
    parser = OptionParser("%prog [options] <path>")
35
37
    parser.set_defaults(
47
49
                      help="Host Loggerhead should listen on.")
48
50
    parser.add_option("--prefix", dest="user_prefix",
49
51
                      help="Specify host prefix.")
 
52
    parser.add_option("--reload", action="store_true", dest="reload",
 
53
                      help="Restarts the application when changing python"
 
54
                           " files. Only used for development purposes.")
 
55
    parser.add_option('--log-folder', dest="log_folder", 
 
56
                      type=str, help="The directory to place log files")
50
57
    parser.add_option("--version", action="store_true", dest="show_version",
51
58
                      help="Print the software version and exit")
52
 
    parser.add_option('--log-folder', dest="log_folder", 
53
 
                      type=str, help="The directory to place log files")
54
59
    return parser
55
60
 
56
61
 
77
82
    if options.trunk_dir and not options.user_dirs:
78
83
        print "--trunk-dir is only valid with --user-dirs"
79
84
        sys.exit(1)
 
85
        
 
86
    if options.reload:
 
87
        if Reloader.is_installed():
 
88
            Reloader.install()
 
89
        else:
 
90
            return Reloader.restart_with_reloader()
80
91
 
81
92
    if options.user_dirs:
82
93
        if not options.trunk_dir:
105
116
    app = HTTPExceptionHandler(app)
106
117
    app = TransLogger(app, logger=logger)
107
118
 
108
 
 
109
119
    if not options.user_prefix:
110
120
        prefix = '/'
111
121
    else: