~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to stop-loggerhead

  • Committer: John Arbash Meinel
  • Date: 2011-03-03 10:58:57 UTC
  • mfrom: (428.2.1 loggerhead)
  • Revision ID: john@arbash-meinel.com-20110303105857-2i83wei3fu4phkef
Use different favicons depending on whether you are browsing a branch, or browsing near a branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
import os
19
19
import sys
 
20
from optparse import OptionParser
20
21
 
21
22
home = os.path.realpath(os.path.dirname(__file__))
22
 
pidfile = os.path.join(home, 'loggerhead.pid')
 
23
default_pidfile = os.path.join(home, 'loggerhead.pid')
 
24
parser = OptionParser(usage='usage: %prog [options]', version='%prog')
 
25
parser.add_option('-p', '--pidfile', dest="pidfile", default=default_pidfile,
 
26
                  help="override pidfile location")
 
27
 
 
28
options, args = parser.parse_args()
 
29
if len(args) > 0:
 
30
    parser.error('No filename arguments are used, only options.')
23
31
 
24
32
try:
25
 
    f = open(pidfile, 'r')
 
33
    f = open(options.pidfile, 'r')
26
34
except IOError, e:
27
 
    print 'No pid file found.'
 
35
    print 'Pid file %s not found.' % (options.pidfile,)
28
36
    sys.exit(1)
29
37
 
30
38
pid = int(f.readline())