Exemplo n.º 1
0
    def post(self):
        print('get job mapper asking')
        try:
            from quantaxis_run import quantaxis_run, run_shell

        except:
            self.write('no quantaxis_run program on this server')
            return
        try:
            from quantaxis_unicorn import run_shell
        except:
            pass
        program = self.get_argument('program', 'python')
        files = self.get_argument('jobfile', False)
        if files:
            print('x')
            #self.wirte({'QUANTAXIS RUN': files})
            res = quantaxis_run.delay(files, program)
            # DATABASE.joblist.insert({'program':program,'files':files,'status':'running','job_id':str(res.id)})
            self.write({'status': 'pending', 'job_id': str(res.id)})

        else:

            res = run_shell.delay(program)
            self.write({'status': 'pending', 'job_id': str(res.id)})
Exemplo n.º 2
0
    def post(self):
        try:
            from quantaxis_run import quantaxis_run
        except:
            self.write('no quantaxis_run program on this server')
            return

        program = self.get_argument('program', 'python')
        files = self.get_argument('jobfile', False)
        if files:
            #self.wirte({'QUANTAXIS RUN': files})
            res = quantaxis_run.delay(files, program)
            self.write({'status': 'pending', 'job_id': str(res.id)})
        else:
            self.write({'status': 'error'})
Exemplo n.º 3
0
    def post(self):
        print('get job mapper asking')
        try:
            from quantaxis_run import quantaxis_run
        except Exception as e:
            print(e)
            self.write('no quantaxis_run program on this server')
            return

        program = self.get_argument('program', 'python')
        content = self.get_argument('content')
        title = self.get_argument('title', str(uuid.uuid4()))

        files = '{}{}_{}.py'.format(cache_path, os.sep, title)
        with open(files, 'w') as w:
            w.write(content)
        res = quantaxis_run.delay(files, program, False)
        self.write({'status': 'pending', 'job_id': str(res.id)})
Exemplo n.º 4
0
    def post(self):
        print('get job mapper asking')
        try:
            from quantaxis_run import quantaxis_run
        except:
            self.write('no quantaxis_run program on this server')
            return

        program = self.get_argument('program', 'python')
        content = self.get_argument('content')

        files = '{}{}_{}.py'.format(cache_path, os.sep, uuid.uuid4())
        with open(files, 'w') as w:
            w.write(content)

        #self.wirte({'QUANTAXIS RUN': files})
        res = quantaxis_run.delay(files, program)
        # DATABASE.joblist.insert({'program':program,'files':files,'status':'running','job_id':str(res.id)})
        self.write({'status': 'pending', 'job_id': str(res.id)})