def start_runner(code, runner, controller_type, callback, prefix=DEFAULT_RUNNER_PREFIX, errback=None, add_close_builtins=None, add_allowed_modules=None, remove_allowed_modules=None, write_execute_data=False, cover_code=None, name='__check__', skip_json_serializer=True): wcode = add_waiter(callback, errback) echo.send_json({ 'do': 'start_runner', 'waiter': wcode, 'code': code, 'runner': runner, 'prefix': prefix, 'type': controller_type, 'name': name, 'env_config': { 'add_close_builtins': add_close_builtins, 'add_allowed_modules': add_allowed_modules, 'remove_allowed_modules': remove_allowed_modules, 'cover_code': cover_code, 'skip_json_serializer': skip_json_serializer, }, 'config': { 'write_execute_data': write_execute_data } }) return wcode
def sys_runner(code, callback, prefix=DEFAULT_RUNNER_PREFIX, errback=None): wcode = add_waiter(callback, errback) echo.send_json({ 'do': 'sys_runner', 'waiter': wcode, 'code': code, 'prefix': prefix }) return wcode
def execute_function(input_data, callback, func=DEFAULT_FUNCTION, prefix=DEFAULT_RUNNER_PREFIX, errback=None): wcode = add_waiter(callback, errback) echo.send_json({ 'do': 'execute_function', 'waiter': wcode, 'func': func, 'prefix': prefix, 'input': input_data }) return wcode
def add_process_listener(prefix, signal, callback): if prefix not in PROCESS_LISTENERS: PROCESS_LISTENERS[prefix] = {} PROCESS_LISTENERS[prefix][signal] = callback echo.send_json({ 'do': 'set_process_informer', 'prefix': prefix, 'signal': signal })
def start_runner(code, runner, controller_type, callback, prefix=DEFAULT_RUNNER_PREFIX, errback=None, add_close_builtins=None, add_allowed_modules=None, remove_allowed_modules=None, write_execute_data=False, cover_code=None, name='__check__'): wcode = add_waiter(callback, errback) echo.send_json({ 'do': 'start_runner', 'waiter': wcode, 'code': code, 'runner': runner, 'prefix': prefix, 'type': controller_type, 'name': name, 'env_config': { 'add_close_builtins': add_close_builtins, 'add_allowed_modules': add_allowed_modules, 'remove_allowed_modules': remove_allowed_modules, 'cover_code': cover_code }, 'config': { 'write_execute_data': write_execute_data } }) return wcode
def kill_runner(prefix): echo.send_json({ 'do': 'kill_runner', 'prefix': prefix })
def request_write(data): echo.send_json({ 'do': 'request_write', 'data': data })
def success(score=0): echo.send_json({'do': 'success', 'score': score})
def kill_runner(prefix): echo.send_json({'do': 'kill_runner', 'prefix': prefix})
def request_write(data): echo.send_json({'do': 'request_write', 'data': data})
def fail(num, description=''): echo.send_json({'do': 'fail', 'num': num, 'description': description})
def close(): echo.send_json({ 'do': 'close' })
def fail(num, description=''): echo.send_json({ 'do': 'fail', 'num': num, 'description': description })
def success(score=0): echo.send_json({ 'do': 'success', 'score': score })
def close(): echo.send_json({'do': 'close'})