~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to serve-branches

  • Committer: Martin Albisetti
  • Date: 2008-09-10 22:53:39 UTC
  • mfrom: (219.1.3 reloader)
  • Revision ID: argentina@gmail.com-20080910225339-p987y5hgtxrq8p5c
Add --reload option to restart LH automatically when developing. (Guillermo Gonzalez)

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
 
32
33
 
33
34
def command_line_parser():
46
47
                      help="Host Loggerhead should listen on.")
47
48
    parser.add_option("--prefix", dest="user_prefix",
48
49
                      help="Specify host prefix.")
 
50
    parser.add_option("--reload", action="store_true", dest="reload",
 
51
                      help="Restarts the application when changing python"
 
52
                           " files. Only used for development purposes.")
49
53
    parser.add_option("--version", action="store_true", dest="show_version",
50
54
                      help="Print the software version and exit")
51
55
    return parser
77
81
    if options.trunk_dir and not options.user_dirs:
78
82
        print "--trunk-dir is only valid with --user-dirs"
79
83
        sys.exit(1)
 
84
        
 
85
    if options.reload:
 
86
        if Reloader.is_installed():
 
87
            Reloader.install()
 
88
        else:
 
89
            return Reloader.restart_with_reloader()
80
90
 
81
91
    if options.user_dirs:
82
92
        if not options.trunk_dir: