You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
666 B
Plaintext
30 lines
666 B
Plaintext
10 years ago
|
#!/usr/bin/env python
|
||
|
|
||
|
import cgitb; cgitb.enable()
|
||
|
import os, sys, cgi, json
|
||
|
from subprocess import PIPE, Popen
|
||
|
from settings import PROJECT_PATH, PROJECT_URL, EDITOR_URL, MAKE
|
||
|
from project import Project
|
||
|
|
||
|
method = os.environ.get("REQUEST_METHOD", "")
|
||
|
fs = cgi.FieldStorage()
|
||
|
project = fs.getvalue("p", "")
|
||
|
paths = fs.getlist("f[]")
|
||
|
|
||
|
ret = {}
|
||
|
ret['stdout'] = ''
|
||
|
ret['stderr'] = ''
|
||
|
ret['returncode'] = -1
|
||
|
|
||
|
if paths:
|
||
|
proj = Project(project)
|
||
|
for p in paths:
|
||
|
fp = os.path.join(proj.fullpath, p)
|
||
|
print >> sys.stderr, "*** rm", fp
|
||
|
os.remove(fp)
|
||
|
ret['returncode'] = 0
|
||
|
|
||
|
print "Content-type: application/json"
|
||
|
print
|
||
|
print json.dumps(ret)
|