-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodefensive.py
More file actions
26 lines (22 loc) · 794 Bytes
/
codefensive.py
File metadata and controls
26 lines (22 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import os
import sys
import cgi
import webapp2
from google.appengine.ext.webapp import template
import transform
title = 'Codefensive 0.1 Beta'
class index(webapp2.RequestHandler):
def get(self):
path = os.path.join(os.path.dirname(__file__),"index.html")
var = {'title':title}
self.response.out.write(template.render(path,var))
class cov(webapp2.RequestHandler):
def post(self):
s = transform.trans(self.request.get('sourcecode'))
path = os.path.join(os.path.dirname(__file__),"cov.html")
var = {'title':title,
'sourcecode':s}
self.response.out.write(template.render(path,var))
app = webapp2.WSGIApplication([('/',index),
('/cov',cov)],
debug=True)