Skip to content
This repository has been archived by the owner on Oct 13, 2021. It is now read-only.

Commit

Permalink
Fixing run-dxr.py to use templates dir.
Browse files Browse the repository at this point in the history
  • Loading branch information
David Humphrey (:humph) committed Oct 20, 2009
1 parent 782cfa2 commit bac3bc2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
3 changes: 1 addition & 2 deletions dxr.config
@@ -1,11 +1,10 @@
[DXR]
xrefscripts=/home/dave/dxr/xref-scripts
wwwsrcfiles=/var/www/html/dxr
templates=/var/www/html/dxr/templates
glimpse=glimpse
glimpseindex=/home/dave/dxr/glimpse/glimpse-4.18.6/bin/glimpseindex

[Web]
wwwdir=/var/www/html/dxr
virtroot=/dxr

[mozilla-central]
Expand Down
18 changes: 9 additions & 9 deletions xref-scripts/run-dxr.py
Expand Up @@ -48,7 +48,7 @@ def parseconfig(filename, doxref, dohtml, tree):
config.read(filename)

xrefscripts = None
wwwsrcfiles = None
templates = None
wwwdir = None
virtroot = None
hosturl = None
Expand All @@ -63,9 +63,9 @@ def parseconfig(filename, doxref, dohtml, tree):
if xrefscripts.endswith('/'):
xrefscripts = xrefscripts[0:-1]

wwwsrcfiles = config.get('DXR', 'wwwsrcfiles')
if wwwsrcfiles.endswith('/'):
wwwsrcfiles = wwwsrcfiles[0:-1]
templates = config.get('DXR', 'templates')
if templates.endswith('/'):
templates = templates[0:-1]

wwwdir = config.get('Web', 'wwwdir')
if wwwdir.endswith('/'):
Expand Down Expand Up @@ -94,10 +94,10 @@ def parseconfig(filename, doxref, dohtml, tree):
print section
print hosturl
print virtroot
print wwwsrcfiles
print templates


WriteOpenSearch(section, hosturl, virtroot, wwwsrcfiles)
WriteOpenSearch(section, hosturl, virtroot, templates)
sourcedir = config.get(section, 'sourcedir')
if sourcedir.endswith('/'):
sourcedir = sourcedir[0:-1]
Expand All @@ -122,8 +122,8 @@ def parseconfig(filename, doxref, dohtml, tree):
# Build static html
if dohtml:
buildhtml = os.path.join(xrefscripts, "build-html.sh")
htmlheader = os.path.join(wwwsrcfiles, "dxr-header.html")
htmlfooter = os.path.join(wwwsrcfiles, "dxr-footer.html")
htmlheader = os.path.join(templates, "dxr-header.html")
htmlfooter = os.path.join(templates, "dxr-footer.html")
dxrsqlite = os.path.join(dbdir, dbname)

retcode = subprocess.call([buildhtml, wwwdir, sourcedir, htmlheader, htmlfooter, dxrsqlite, section, virtroot])
Expand All @@ -136,7 +136,7 @@ def parseconfig(filename, doxref, dohtml, tree):
retcode = subprocess.call([buildglimpse, wwwdir, section, dbdir, glimpseindex])

# Generate index page with drop-down + opensearch links for all trees
indexhtml = ReadFile(os.path.join(wwwsrcfiles, 'dxr-index-template.html'))
indexhtml = ReadFile(os.path.join(templates, 'dxr-index-template.html'))
indexhtml = indexhtml.replace('$OPTIONS', options)
indexhtml = indexhtml.replace('$OPENSEARCH', opensearch)
index = open(os.path.join(wwwdir, 'index.html'), 'w')
Expand Down

0 comments on commit bac3bc2

Please sign in to comment.