haybale-haystack 0.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- haybale_haystack/__init__.py +74 -0
- haybale_haystack/editors/__init__.py +0 -0
- haybale_haystack/editors/haystack_editor.py +879 -0
- haybale_haystack/graph_entry.py +124 -0
- haybale_haystack/panels/__init__.py +0 -0
- haybale_haystack/panels/file_browser/open_in_haystack.py +73 -0
- haybale_haystack/persistence.py +261 -0
- haybale_haystack/settings/__init__.py +0 -0
- haybale_haystack/settings/haystack_settings.py +26 -0
- haybale_haystack/signals.py +45 -0
- haybale_haystack/state/__init__.py +0 -0
- haybale_haystack/state/haystack_state.py +535 -0
- haybale_haystack-0.0.2.dist-info/METADATA +10 -0
- haybale_haystack-0.0.2.dist-info/RECORD +16 -0
- haybale_haystack-0.0.2.dist-info/WHEEL +4 -0
- haybale_haystack-0.0.2.dist-info/entry_points.txt +2 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"""Haybale-Haystack: file-centric multi-graph manager.
|
|
2
|
+
|
|
3
|
+
Provides:
|
|
4
|
+
- HaystackState (AppState): in-memory registry of open graphs.
|
|
5
|
+
- HaystackSettings (LibrarySettings): per-workspace persistence of
|
|
6
|
+
last_haystack_name and new_counter.
|
|
7
|
+
- persistence module: free functions for per-haystack TOML I/O.
|
|
8
|
+
- GraphEditor and HaystackEditor: UI surfaces.
|
|
9
|
+
- "Open in Haystack" file-context-menu panel.
|
|
10
|
+
|
|
11
|
+
Intended as ONE possible graph-management library for Haywire. Future
|
|
12
|
+
libraries may provide alternative managers; haybale-haystack does not
|
|
13
|
+
claim exclusive ownership of GraphEditor.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
from importlib.metadata import version as _pkg_version
|
|
17
|
+
from pathlib import Path
|
|
18
|
+
|
|
19
|
+
from haywire.core.library.base import BaseLibrary
|
|
20
|
+
from haywire.core.library.decorator import library
|
|
21
|
+
from haywire.core.settings.registry import SettingsRegistry
|
|
22
|
+
from haywire.core.state import LibraryStateRegistry
|
|
23
|
+
|
|
24
|
+
from haywire.ui.editor.registry import EditorTypeRegistry
|
|
25
|
+
from haywire.ui.panel.registry import PanelRegistry
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@library(
|
|
29
|
+
label="Haystack",
|
|
30
|
+
id="haystack",
|
|
31
|
+
version=_pkg_version("haybale-haystack"),
|
|
32
|
+
description="File-centric multi-graph manager",
|
|
33
|
+
url="",
|
|
34
|
+
help_url="",
|
|
35
|
+
author="",
|
|
36
|
+
author_url="",
|
|
37
|
+
dependencies=["haybale_studio", "haybale_graph_editor"],
|
|
38
|
+
tags=["graph-management"],
|
|
39
|
+
file_watcher=True,
|
|
40
|
+
)
|
|
41
|
+
class Library(BaseLibrary):
|
|
42
|
+
"""Haystack library — file-centric graph management."""
|
|
43
|
+
|
|
44
|
+
def register_components(self):
|
|
45
|
+
base_path = Path(__file__).parent
|
|
46
|
+
|
|
47
|
+
# Within-library folder ordering no longer matters for the
|
|
48
|
+
# HaystackState rehydrate path: LibraryStateContainer.on_library_enabled
|
|
49
|
+
# is called by LibraryRegistry only AFTER this library's enable()
|
|
50
|
+
# returns, so HaystackSettings (in settings/) is always wired by the
|
|
51
|
+
# time HaystackState.on_enable fires. Keeping settings/ first is just
|
|
52
|
+
# convention.
|
|
53
|
+
self.add_folder_to_registry(
|
|
54
|
+
folder_path=str(base_path / "settings"),
|
|
55
|
+
registry_cls=SettingsRegistry,
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
self.add_folder_to_registry(
|
|
59
|
+
folder_path=str(base_path / "state"),
|
|
60
|
+
registry_cls=LibraryStateRegistry,
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
self.add_folder_to_registry(
|
|
64
|
+
folder_path=str(base_path / "panels"),
|
|
65
|
+
registry_cls=PanelRegistry,
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
self.add_folder_to_registry(
|
|
69
|
+
folder_path=str(base_path / "editors"),
|
|
70
|
+
registry_cls=EditorTypeRegistry,
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
def validate(self) -> bool:
|
|
74
|
+
return True
|
|
File without changes
|