doc: fslist1 "watch" option is true by default

This is not completely obvious, and one of our components even got it
wrong. But src/bridge/cockpitfslist.c implements it that way, and
several of our pages rely on it.

Also fix the default in the Python bridge.
This commit is contained in:
Martin Pitt 2023-01-16 12:21:38 +01:00 committed by Martin Pitt
parent 1a969348dd
commit 7ef8a2cc04
2 changed files with 2 additions and 2 deletions

View File

@ -867,7 +867,7 @@ The following options can be specified in the "open" control message:
* "path": The path name of the directory to watch. This should be an
absolute path.
* "watch": Boolean, when true the directory will be watched and signal
on changes.
on changes. Defaults to "true"
The channel will send a number of JSON messages that list the current
content of the directory. These messages have a "event" field with

View File

@ -63,7 +63,7 @@ class FsListChannel(Channel):
def do_open(self, options):
path = options.get('path')
watch = options.get('watch')
watch = options.get('watch', True)
for entry in os.scandir(path):
self.send_entry("present", entry)