Exemple #1
0
 async def do_submission(self):
     loop = get_event_loop()
     logger.info('Submission: %s, %s, %s', self.domain_id, self.pid, self.rid)
     cases_file_task = loop.create_task(cache_open(self.session, self.domain_id, self.pid))
     package = await self.build()
     with await cases_file_task as cases_file:
         await self.judge(cases_file, package)
Exemple #2
0
 async def prepare(self):
     loop = get_event_loop()
     config_file = await loop.create_task(
         cache_open(self.session, self.domain_id, self.pid))
     if not has_lang(self.lang):
         raise SystemError('Unsupported language: {}'.format(self.lang))
     self.config = read_config(config_file, self.lang, self.judge_category)
Exemple #3
0
 async def submission(self):
     domain_id = self.request.pop('domain_id')
     pid = self.request.pop('pid')
     rid = self.request.pop('rid')
     logger.info('Submission: %s, %s, %s', domain_id, pid, rid)
     cases_file, package = await gather(
         cache_open(self.session, domain_id, pid), self.build())
     try:
         await self.judge(cases_file, package)
     finally:
         cases_file.close()