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>") body.write("<ul>")
for name,puzzlefile in sorted(puzzle.files.items()): for name,puzzlefile in sorted(puzzle.files.items()):
if puzzlefile.visible: if puzzlefile.visible:
visibility = 'listed as a generated file' visibility = ''
else: else:
visibility = 'unlisted' visibility = '(unlisted)'
body.write('<li><a href="/puzzles/{cat}/{points}/{filename}">{filename}</a> ({visibility})</li>' body.write('<li><a href="/puzzles/{cat}/{points}/{filename}">{filename}</a> {visibility}</li>'
.format(cat=parts[2], .format(cat=parts[2],
points=puzzle.points, points=puzzle.points,
filename=name, filename=name,

View File

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