Skip to content

Commit

Permalink
kvs: add rst format to inline docs
Browse files Browse the repository at this point in the history
Problem: on the web version of the docs, which are
auto-generated, multiple lines of python appear on
the same line, and are formatted weirdly.

We can add rst format to the inline docs.
  • Loading branch information
wihobbs committed Dec 12, 2024
1 parent 8ee6a97 commit d8c4ec7
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/bindings/python/flux/kvs.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,20 +478,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 :: python
mydir["newkey"] = "foo"
mydir.commit()
mydir = KVSDir(flux_handle)
print(mydir["mykey"])
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.
.. code-block :: python
mydir = KVSDir(flux_handle)
subdir = mydir["subdir"]
subdir["anotherkey"] = "bar"
mydir.commit()
mydir = KVSDir(flux_handle)
subdir = mydir["subdir"]
subdir["anotherkey"] = "bar"
mydir.commit()
Args:
flux_handle: A Flux handle obtained from flux.Flux()
Expand Down

0 comments on commit d8c4ec7

Please sign in to comment.