aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/src/meshbay_node/roots.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-node/src/meshbay_node/roots.py')
-rw-r--r--packages/meshbay-node/src/meshbay_node/roots.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/packages/meshbay-node/src/meshbay_node/roots.py b/packages/meshbay-node/src/meshbay_node/roots.py
index 8f999d7..bc27bf7 100644
--- a/packages/meshbay-node/src/meshbay_node/roots.py
+++ b/packages/meshbay-node/src/meshbay_node/roots.py
@@ -51,6 +51,7 @@ class Root:
path: Path
kind: str = "generic"
upload: bool = False
+ direct: bool = False
# Runtime, not configuration: set by the indexer when the directory can no
# longer be read, and cleared when it comes back.
available: bool = True
@@ -139,7 +140,8 @@ class RootSet:
kind = "generic"
root = Root(name=name, path=path, kind=kind,
- upload=bool(spec.get("upload", False)))
+ upload=bool(spec.get("upload", False)),
+ direct=bool(spec.get("direct", False)))
_refuse_nesting(root, roots)
roots.append(root)
by_folded[root.folded] = root
@@ -277,11 +279,14 @@ class RootSet:
def describe(self) -> list[dict]:
"""Per-root state for the index payload and the admin UI."""
- return [
- {"name": r.name, "kind": r.kind, "available": r.available,
- "upload": r.upload}
- for r in self.roots
- ]
+ out = []
+ for r in self.roots:
+ d: dict = {"name": r.name, "kind": r.kind,
+ "available": r.available, "upload": r.upload}
+ if r.direct:
+ d["direct"] = True
+ out.append(d)
+ return out
def entry_abs_path(roots: RootSet, entry) -> Path | None: