|
@@ -2,19 +2,15 @@
|
|
|
import asyncio
|
|
|
from collections import defaultdict
|
|
|
from justpy.htmlcomponents import HTMLBaseComponent
|
|
|
-import time
|
|
|
-import logging
|
|
|
|
|
|
bindings = defaultdict(list)
|
|
|
bindable_properties = set()
|
|
|
active_links = []
|
|
|
|
|
|
async def loop():
|
|
|
- global active_links
|
|
|
while True:
|
|
|
visited = set()
|
|
|
invalidated_views = []
|
|
|
- to_delete = []
|
|
|
for link in active_links:
|
|
|
(source_obj, source_name, target_obj, target_name, transform) = link
|
|
|
value = transform(getattr(source_obj, source_name))
|
|
@@ -23,11 +19,6 @@ async def loop():
|
|
|
propagate(target_obj, target_name, visited)
|
|
|
if hasattr(target_obj, 'view') and isinstance(target_obj.view, HTMLBaseComponent):
|
|
|
invalidated_views.append(target_obj.view)
|
|
|
- # remove links if the justpy element has been deleted
|
|
|
- if getattr(target_obj, 'delete_flag', False) or getattr(source_obj, 'delete_flag', False):
|
|
|
- to_delete.append(link)
|
|
|
- active_links = [l for l in active_links if l not in to_delete]
|
|
|
-
|
|
|
for view in invalidated_views:
|
|
|
await view.update()
|
|
|
await asyncio.sleep(0.1)
|