コード例 #1
0
ファイル: packet.py プロジェクト: mymachine8/Online-Judge
 def handshake(self, problems, id, key):
     self._send_packet({'name': 'handshake',
                        'problems': problems,
                        'executors': executors.keys(),
                        'id': id,
                        'key': key})
     try:
         resp = self._read_single()
     except Exception:
         traceback.print_exc()
         raise JudgeAuthenticationFailed()
     else:
         if resp['name'] != 'handshake-success':
             raise JudgeAuthenticationFailed()
コード例 #2
0
 def handshake(self, problems, id, key):
     self._send_packet({'name': 'handshake',
                        'problems': problems,
                        'executors': executors.keys(),
                        'id': id,
                        'key': key})
     try:
         resp = self._read_single()
     except Exception:
         traceback.print_exc()
         raise JudgeAuthenticationFailed()
     else:
         if resp['name'] != 'handshake-success':
             raise JudgeAuthenticationFailed()
コード例 #3
0
 def supported_executors_packet(self):
     logger.info('Update executors: %s', executors.keys())
     self._send_ping_packet({
         'name': 'executor-update',
         'executors': executors.keys(),
     })