More sensical reporting on file visibility

This commit is contained in:
Neale Pickett 2017-10-03 16:06:44 -06:00
parent ee2fa601d8
commit cbe671dbc2
2 changed files with 4 additions and 4 deletions

View File

@ -163,10 +163,10 @@ you are a fool.
body.write("<ul>")
for name,puzzlefile in sorted(puzzle.files.items()):
if puzzlefile.visible:
visibility = 'listed as a generated file'
visibility = ''
else:
visibility = 'unlisted'
body.write('<li><a href="/puzzles/{cat}/{points}/{filename}">{filename}</a> ({visibility})</li>'
visibility = '(unlisted)'
body.write('<li><a href="/puzzles/{cat}/{points}/{filename}">{filename}</a> {visibility}</li>'
.format(cat=parts[2],
points=puzzle.points,
filename=name,

View File

@ -108,7 +108,7 @@ class Puzzle:
stream = open(name, 'rb')
try:
name = parts[1]
hidden = parts[2]
hidden = (parts[2].lower() == "hidden")
except IndexError:
pass
self.files[name] = PuzzleFile(stream, name, not hidden)