#!{{ python_executable }} import cgi import cgitb import ConfigParser import os cgitb.enable() form = cgi.FieldStorage() print "" print "" print "" print "" config_file = "{{ config_cfg }}" if not os.path.exists(config_file): print "Your software does not embed 0-knowledge. \ This interface is useless in this case" exit(0) parser = ConfigParser.ConfigParser() parser.read(config_file) if not parser.has_section('public'): print "

Your software does not use 0-knowledge settings.

" exit(0) for name in form: if parser.has_option('public', name): parser.set('public', name, form[name].value) with open(config_file, 'w') as file: parser.write(file) if len(form) > 0: try: os.remove("{{ timestamp }}") except OSError: pass print "

Values that can be defined :

" print "
" print "" for option in parser.options("public"): print "
" print "" % (cgi.escape(option, quote=True), cgi.escape(option)) print "" % (cgi.escape(option, quote=True), cgi.escape(parser.get('public', option), quote=True)) print "
" print "
" print "

Other values :

" print "
" for section in parser.sections(): if section != 'public': for option in parser.options(section): print "
" print "" % (cgi.escape(option, quote=True), cgi.escape(option)) print "" %(cgi.escape(option, quote=True), cgi.escape(parser.get(section, option), quote=True)) print "
" print "
" print ""