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)
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)
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')
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')