예제 #1
0
파일: api.py 프로젝트: dbenders/radstore
	def GET(self, name=None, transformation=None, **kwargs):
		if name is not None:
			q = Processes.find_one({'name':name})
			cherrypy.response.headers['Access-Control-Allow-Origin'] = '*'
			return self.build_response('ok', **{'process':q})
		else:
			return super(ProcessesController, self).GET(name, **kwargs)
예제 #2
0
 def GET(self, name=None, transformation=None, **kwargs):
     if name is not None:
         q = Processes.find_one({'name': name})
         cherrypy.response.headers['Access-Control-Allow-Origin'] = '*'
         return self.build_response('ok', **{'process': q})
     else:
         return super(ProcessesController, self).GET(name, **kwargs)
예제 #3
0
파일: api.py 프로젝트: dbenders/radstore
	def POST(self, name, transformation, **kwargs):
		params = ['%s=%s' % (k,v) for k,v in simplejson.load(cherrypy.request.body).items()]
		q = Processes.find_one({'name':name})
		cmdline =  q['executable'].split() + [transformation] + params
		print "(%s) %s" % (q['working_dir'],cmdline)
		p = subprocess.Popen(cmdline, cwd=q['working_dir'])
		out = p.communicate()
		cherrypy.response.headers['Access-Control-Allow-Origin'] = '*'
		return self.build_response('ok')
예제 #4
0
 def POST(self, name, transformation, **kwargs):
     params = [
         '%s=%s' % (k, v)
         for k, v in simplejson.load(cherrypy.request.body).items()
     ]
     q = Processes.find_one({'name': name})
     cmdline = q['executable'].split() + [transformation] + params
     print "(%s) %s" % (q['working_dir'], cmdline)
     p = subprocess.Popen(cmdline, cwd=q['working_dir'])
     out = p.communicate()
     cherrypy.response.headers['Access-Control-Allow-Origin'] = '*'
     return self.build_response('ok')