コード例 #1
0
 def set_property(self, name, ranks):
     error = ffi.new("flux_error_t *")
     try:
         self.pimpl.add_property(error, name, ranks)
     except OSError as exc:
         raise ValueError("set_property: " +
                          ffi.string(error.text).decode("utf-8")) from exc
コード例 #2
0
 def copy_constraint(self, constraint):
     error = ffi.new("flux_error_t *")
     if not isinstance(constraint, str):
         constraint = json.dumps(constraint)
     try:
         handle = self.pimpl.copy_constraint_string(constraint, error)
     except OSError as exc:
         raise ValueError("copy_constraint: " +
                          ffi.string(error.text).decode("utf-8")) from exc
     return Rlist(handle=handle)
コード例 #3
0
ファイル: Rlist.py プロジェクト: vchuravy/flux-core
 def encode(self):
     val = lib.rlist_encode(self.handle)
     result = ffi.string(val).decode("utf-8")
     lib.free(val)
     return result