bye bye sandia

This commit is contained in:
J. Patrick Avery, Jr 2017-02-05 18:06:36 -07:00
parent 78a0fa1f1b
commit 2a3970d5e3
7 changed files with 13 additions and 13 deletions

View File

@ -31,10 +31,10 @@ def write_kv_pairs(ziphandle, filename, kv):
filehandle.write("%s %s\n" % (key, kv[key])) filehandle.write("%s %s\n" % (key, kv[key]))
filehandle.seek(0) filehandle.seek(0)
ziphandle.writestr(filename, filehandle.read()) ziphandle.writestr(filename, filehandle.read())
def escape(s): def escape(s):
return s.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;') return s.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;')
def generate_html(ziphandle, puzzle, puzzledir, category, points, authors, files): def generate_html(ziphandle, puzzle, puzzledir, category, points, authors, files):
html_content = io.StringIO() html_content = io.StringIO()
file_content = io.StringIO() file_content = io.StringIO()
@ -50,7 +50,7 @@ def generate_html(ziphandle, puzzle, puzzledir, category, points, authors, files
''' </ul> ''' </ul>
</section> </section>
''') ''')
html_content.write( html_content.write(
'''<!DOCTYPE html> '''<!DOCTYPE html>
<html> <html>
@ -77,7 +77,7 @@ def generate_html(ziphandle, puzzle, puzzledir, category, points, authors, files
<section id="sponsors"> <section id="sponsors">
<img src="../../images/lanl.png" alt="Los Alamos National Laboratory"> <img src="../../images/lanl.png" alt="Los Alamos National Laboratory">
<img src="../../images/doe.png" alt="US Department Of Energy"> <img src="../../images/doe.png" alt="US Department Of Energy">
<img src="../../images/sandia.png" alt="Sandia National Laboratories"> <img src="../../images/inl.png" alt="Idaho National Laboratory">
</section> </section>
</body> </body>
</html>'''.format(category=category, points=points, body=puzzle.html_body(), file_content=file_content.getvalue(), authors=', '.join(authors))) </html>'''.format(category=category, points=points, body=puzzle.html_body(), file_content=file_content.getvalue(), authors=', '.join(authors)))
@ -118,7 +118,7 @@ def build_category(categorydir, outdir):
hashmap = hashlib.sha1(category_seed) hashmap = hashlib.sha1(category_seed)
hashmap.update(str(puzzle.points).encode('utf-8')) hashmap.update(str(puzzle.points).encode('utf-8'))
puzzlehash = hashmap.hexdigest() puzzlehash = hashmap.hexdigest()
mapping[puzzle.points] = puzzlehash mapping[puzzle.points] = puzzlehash
answers[puzzle.points] = puzzle.answers answers[puzzle.points] = puzzle.answers
summary[puzzle.points] = puzzle.summary summary[puzzle.points] = puzzle.summary
@ -149,9 +149,9 @@ def build_category(categorydir, outdir):
zf.close() zf.close()
shutil.move(zipfileraw.name, zipfilename) shutil.move(zipfileraw.name, zipfilename)
if __name__ == '__main__': if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Build a category package') parser = argparse.ArgumentParser(description='Build a category package')
parser.add_argument('categorydirs', nargs='+', help='Directory of category source') parser.add_argument('categorydirs', nargs='+', help='Directory of category source')
parser.add_argument('outdir', help='Output directory') parser.add_argument('outdir', help='Output directory')

View File

@ -43,7 +43,7 @@ function koth.page(title, body)
print('<section id="sponsors">') print('<section id="sponsors">')
print('<img src="../images/lanl.png" alt="Los Alamos National Laboratory">') print('<img src="../images/lanl.png" alt="Los Alamos National Laboratory">')
print('<img src="../images/doe.png" alt="US Department Of Energy">') print('<img src="../images/doe.png" alt="US Department Of Energy">')
print('<img src="../images/sandia.png" alt="Sandia National Laboratories">') print('<img src="../images/inl.png" alt="Idaho National Laboratory">')
print('</section>') print('</section>')
print("</body></html>") print("</body></html>")
os.exit(0) os.exit(0)

View File

@ -90,7 +90,7 @@ window.addEventListener("load", init);
<section id="sponsors"> <section id="sponsors">
<img src="images/lanl.png" alt="Los Alamos National Laboratory"> <img src="images/lanl.png" alt="Los Alamos National Laboratory">
<img src="images/doe.png" alt="US Department Of Energy"> <img src="images/doe.png" alt="US Department Of Energy">
<img src="images/sandia.png" alt="Sandia National Laboratories"> <img src="images/inl.png" alt="Idaho National Laboratory">
</section> </section>
</body> </body>
</html> </html>

BIN
www/images/inl.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

View File

@ -69,7 +69,7 @@
<section id="sponsors"> <section id="sponsors">
<img src="images/lanl.png" alt="Los Alamos National Laboratory"> <img src="images/lanl.png" alt="Los Alamos National Laboratory">
<img src="images/doe.png" alt="US Department Of Energy"> <img src="images/doe.png" alt="US Department Of Energy">
<img src="images/sandia.png" alt="Sandia National Laboratories"> <img src="images/inl.png" alt="Idaho National Laboratory">
</section> </section>
</body> </body>
</html> </html>

View File

@ -44,7 +44,7 @@
<section id="sponsors"> <section id="sponsors">
<img src="images/lanl.png" alt="Los Alamos National Laboratory"> <img src="images/lanl.png" alt="Los Alamos National Laboratory">
<img src="images/doe.png" alt="US Department Of Energy"> <img src="images/doe.png" alt="US Department Of Energy">
<img src="images/sandia.png" alt="Sandia National Laboratories"> <img src="images/inl.png" alt="Idaho National Laboratory">
</section> </section>
</body> </body>
</html> </html>

View File

@ -116,7 +116,7 @@
<section id="sponsors"> <section id="sponsors">
<img src="images/lanl.png" alt="Los Alamos National Laboratory"> <img src="images/lanl.png" alt="Los Alamos National Laboratory">
<img src="images/doe.png" alt="US Department Of Energy"> <img src="images/doe.png" alt="US Department Of Energy">
<img src="images/sandia.png" alt="Sandia National Laboratories"> <img src="images/inl.png" alt="Idaho National Laboratory">
</section> </section>
</body> </body>
</html> </html>