Skip to content

Commit

Permalink
Re #6897. Added more options to checkmissing.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterfpeterson committed Apr 23, 2013
1 parent 4c4a57b commit dc5c7c6
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions Code/Mantid/docs/qtassistant/checkmissingimg.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ def processHtml(htmldir, filename):
import optparse
parser = optparse.OptionParser(usage="usage: %prog [options] <htmldir>",
description="Determine if there are images missing from the built documentation.")
parser.add_option('', '--shortnames', dest='shortnames',
default=False, action="store_true",
help="Only print the names of missing images rather than full path")
parser.add_option('', '--nosummary', dest='summary',
default=True, action="store_false",
help="Turn off the summary information")
(options, args) = parser.parse_args()

# get the html base directory
Expand All @@ -72,17 +78,23 @@ def processHtml(htmldir, filename):

# get the list of html files
htmlfiles = getHtml(htmldir)
print "Verifying %d html files in '%s'" % (len(htmlfiles), htmldir)
if options.summary:
print "Verifying %d html files in '%s'" % (len(htmlfiles), htmldir)

# determine what images are missing
missing = []
for filename in htmlfiles:
missing.extend(processHtml(htmldir, filename))

# remove repeated filenames
missing = set(missing)
missing = list(set(missing))
missing.sort()

# print the results
print "Missing %d image files" % len(missing)
if options.summary:
print "Missing %d image files" % len(missing)
for filename in missing:
print filename
if options.shortnames:
print os.path.split(filename)[-1]
else:
print filename

0 comments on commit dc5c7c6

Please sign in to comment.