Example #1
0
        def __init__(self, flux_handle=None, path='.', handle=None):
            self.handle = None
            if flux_handle is None and handle is None:  # pragma: no cover
                raise ValueError(
                    "flux_handle must be a valid Flux object or handle must be a valid kvsdir cdata pointer")
            if handle is None:
                d = ffi.new("kvsdir_t *[1]")
                _raw.kvs_get_dir(flux_handle, d, path)
                handle = d[0]

            super(self.__class__, self).__init__(ffi, lib,
                                                 handle=handle,
                                                 match=ffi.typeof('kvsdir_t *'),
                                                 prefixes=[
                                                     'kvsdir_',
                                                 ], )
Example #2
0
        def __init__(self, flux_handle=None, path='.', handle=None):
            super(self.__class__, self).__init__(ffi, lib,
                                                 handle=handle,
                                                 match=ffi.typeof('kvsdir_t *'),
                                                 prefixes=[
                                                     'kvsdir_',
                                                 ],
                                                 destructor=_raw.kvsdir_destroy)

            if flux_handle is None and handle is None:  # pragma: no cover
                raise ValueError(
                    "flux_handle must be a valid Flux object or handle must be a valid kvsdir cdata pointer")
            if handle is None:
                d = ffi.new("kvsdir_t *[1]")
                _raw.kvs_get_dir(flux_handle, d, path)
                self.handle = d[0]
                if self.handle is None or self.handle == ffi.NULL:
                    raise EnvironmentError("No such file or directory")
Example #3
0
        def __init__(self, flux_handle=None, path='.', handle=None):
            self.handle = None
            if flux_handle is None and handle is None:  # pragma: no cover
                raise ValueError(
                    "flux_handle must be a valid Flux object or handle must be a valid kvsdir cdata pointer"
                )
            if handle is None:
                d = ffi.new("kvsdir_t *[1]")
                _raw.kvs_get_dir(flux_handle, d, path)
                handle = d[0]

            super(self.__class__, self).__init__(
                ffi,
                lib,
                handle=handle,
                match=ffi.typeof('kvsdir_t *'),
                prefixes=[
                    'kvsdir_',
                ],
            )