コード例 #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')