#!/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, 'players', quote(team, safe='')) file = open(path, 'w') file.write('Team: %s\n' % quote(team)) file.write('Color: #%s\n' % teams.color(team)) file.write('Content-Type: text/x-tanks-bullet\n') file.write('\n') file.write(code) file.close() body = ("Submission successful.
") html.serve('Tanks Submission', body, links=links)