Example #1
0
 def __init__(self, **kwargs):
     self.current_submission = None
     self.current_proc = None
     self.current_submission_thread = None
     self._terminate_grading = False
     if Observer is not None:
         handler = SendProblemsHandler(self)
         self._monitor = monitor = Observer()
         for dir in get_problem_roots():
             monitor.schedule(handler, dir, recursive=True)
         monitor.start()
     else:
         self._monitor = None
Example #2
0
 def __init__(self, **kwargs):
     self.current_submission = None
     self.current_proc = None
     self.current_submission_thread = None
     self._terminate_grading = False
     if Observer is not None:
         handler = SendProblemsHandler(self)
         self._monitor = monitor = Observer()
         for dir in get_problem_roots():
             monitor.schedule(handler, dir, recursive=True)
         monitor.start()
     else:
         self._monitor = None
Example #3
0
 def supported_problems(self):
     """
     Fetches a list of all problems supported by this judge.
     :return:
         A list of all problems in tuple format: (problem id, mtime)
     """
     problems = []
     for dir in get_problem_roots():
         for problem in os.listdir(dir):
             if isinstance(problem, str):
                 problem = problem.decode(fs_encoding)
             if os.access(os.path.join(dir, problem, 'init.json'), os.R_OK):
                 problems.append((problem, os.path.getmtime(os.path.join(dir, problem))))
     return problems
Example #4
0
 def __init__(self, host, port, **kwargs):
     self.packet_manager = packet.PacketManager(host, port, self, env['id'], env['key'])
     self.current_submission = None
     self.current_proc = None
     self.current_submission_thread = None
     self._terminate_grading = False
     if Observer is not None:
         handler = SendProblemsHandler(self)
         self._monitor = monitor = Observer()
         for dir in get_problem_roots():
             monitor.schedule(handler, dir, recursive=True)
         monitor.start()
     else:
         self._monitor = None
Example #5
0
 def __init__(self, host, port, **kwargs):
     self.packet_manager = packet.PacketManager(host, port, self, env['id'],
                                                env['key'])
     self.current_submission = None
     self.current_proc = None
     self.current_submission_thread = None
     self._terminate_grading = False
     if Observer is not None:
         handler = SendProblemsHandler(self)
         self._monitor = monitor = Observer()
         for dir in get_problem_roots():
             monitor.schedule(handler, dir, recursive=True)
         monitor.start()
     else:
         self._monitor = None
Example #6
0
 def supported_problems(self):
     """
     Fetches a list of all problems supported by this judge.
     :return:
         A list of all problems in tuple format: (problem id, mtime)
     """
     problems = []
     for dir in get_problem_roots():
         for problem in os.listdir(dir):
             if isinstance(problem, str):
                 problem = problem.decode(fs_encoding)
             if os.access(os.path.join(dir, problem, 'init.json'), os.R_OK):
                 problems.append(
                     (problem, os.path.getmtime(os.path.join(dir,
                                                             problem))))
     return problems