forked from genewildish/Mainline
fix: ListDataSource cache and camera dependency resolution
Two critical fixes: 1. ListDataSource Cache Bug - Previously, ListDataSource.__init__ cached raw tuples directly - get_items() would return cached raw tuples without converting to SourceItem - This caused SourceItemsToBufferStage to receive tuples and stringify them - Results: ugly tuple representations in terminal/pygame instead of formatted text - Fix: Store raw items in _raw_items, let fetch() convert to SourceItem - Cache now contains proper SourceItem objects 2. Camera Dependency Resolution - CameraStage declared dependency on 'source.items' exactly - DataSourceStage provides 'source.headlines' (or 'source.poetry', etc.) - Capability matching didn't trigger prefix match for exact dependency - Fix: Change CameraStage dependency to 'source' for prefix matching 3. Added app.py Camera Stage Support - Pipeline now adds camera stage from preset.camera config - Supports vertical, horizontal, omni, floating, bounce modes - Tests now passing with proper data flow through all stages Tests: All 502 tests passing, 16 skipped
This commit is contained in:
@@ -124,7 +124,8 @@ class ListDataSource(DataSource):
|
||||
"""
|
||||
|
||||
def __init__(self, items, name: str = "list"):
|
||||
self._items = items
|
||||
self._raw_items = items # Store raw items separately
|
||||
self._items = None # Cache for converted SourceItem objects
|
||||
self._name = name
|
||||
|
||||
@property
|
||||
@@ -138,7 +139,7 @@ class ListDataSource(DataSource):
|
||||
def fetch(self) -> list[SourceItem]:
|
||||
# Convert tuple items to SourceItem if needed
|
||||
result = []
|
||||
for item in self._items:
|
||||
for item in self._raw_items:
|
||||
if isinstance(item, SourceItem):
|
||||
result.append(item)
|
||||
elif isinstance(item, tuple) and len(item) >= 3:
|
||||
|
||||
Reference in New Issue
Block a user