Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kvs: add rst format to inline docs #6503

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions src/bindings/python/flux/kvs.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,10 @@ class KVSTxn:
Can be used as a context manager and commits will be handled at
exit. e.g.

with KVSTxn(handle, "basedirectory") as kt:
kt.put("a", 1)
.. code-block::

with KVSTxn(handle, "basedirectory") as kt:
kt.put("a", 1)

Args:
flux_handle: A Flux handle obtained from flux.Flux()
Expand Down Expand Up @@ -478,20 +480,24 @@ class KVSDir(WrapperPimpl, abc.MutableMapping):

KVS values can be read or written through this class's item accessor. e.g.

mydir = KVSDir(flux_handle)
print(mydir["mykey"])
.. code-block::

mydir = KVSDir(flux_handle)
print(mydir["mykey"])

mydir["newkey"] = "foo"
mydir.commit()
mydir["newkey"] = "foo"
mydir.commit()

Any KVS directories accessed through the item accessor will share
the same internal KVS transaction, so that only a single call to
commit() is necessary. e.g.

mydir = KVSDir(flux_handle)
subdir = mydir["subdir"]
subdir["anotherkey"] = "bar"
mydir.commit()
.. code-block::

mydir = KVSDir(flux_handle)
subdir = mydir["subdir"]
subdir["anotherkey"] = "bar"
mydir.commit()

Args:
flux_handle: A Flux handle obtained from flux.Flux()
Expand All @@ -506,7 +512,6 @@ class KVSDir(WrapperPimpl, abc.MutableMapping):
# pylint: disable=too-many-ancestors, too-many-public-methods

class InnerWrapper(Wrapper):

# pylint: disable=no-value-for-parameter
def __init__(self, flux_handle=None, path=".", handle=None, namespace=None):
dest = RAW.flux_kvsdir_destroy
Expand Down
Loading