mirror of https://github.com/dirtbags/moth.git
More sensical reporting on file visibility
This commit is contained in:
parent
ee2fa601d8
commit
cbe671dbc2
|
@ -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,
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue