#!/usr/bin/python import cgi import cgitb; cgitb.enable() import os import sys from urllib import quote from ctf import teams, html, paths basedir = os.path.join(paths.VAR, 'tanks') links = '''
Authentication failed.
' elif not code: body = 'No program given.
' else: path = os.path.join(basedir, 'ai/players', quote(team, safe='')) file = open(path, 'w') file.write(code) file.close() body = ("Submission successful.
") html.serve('Tanks Submission', body, links=links)