def JSCNotifyWrapper(jcb, arg, errnum): if jcb != ffi.NULL: jcb = ffi.string(jcb) cb, real_arg = ffi.from_handle(arg) # TODO: necessary to check errnum? ret = cb(jcb, real_arg, errnum) return ret if ret is not None else 0
def query_jcb(flux_handle, jobid, key): jcb_str = ffi.new('char *[1]') _raw.query_jcb(flux_handle, jobid, key, jcb_str) if jcb_str[0] == ffi.NULL: return None else: return ffi.string(jcb_str[0])
def query_jcb(flux_handle, jobid, key): jcb_str = ffi.new('char *[1]') RAW.query_jcb(flux_handle, jobid, key, jcb_str) if jcb_str[0] == ffi.NULL: return None else: return ffi.string(jcb_str[0])
def job_num2state(job_state): ret = _raw.job_num2state(job_state) if ret == ffi.NULL: return None else: return ffi.string(ret)
def job_num2state(job_state): ret = RAW.job_num2state(job_state) if ret == ffi.NULL: return None else: return ffi.string(ret)
def jsc_notify_wrapper(jcb, arg, errnum): if jcb != ffi.NULL: jcb = ffi.string(jcb) callback, real_arg = ffi.from_handle(arg) ret = callback(jcb, real_arg, errnum) return ret if ret is not None else 0