From 0d3aee1dba3d8c58272fbd6ab692fca7ca00bc3e Mon Sep 17 00:00:00 2001 From: Jedrzej Nowak Date: Fri, 18 Sep 2015 15:55:55 +0200 Subject: [PATCH] Still wip, but connections are ok --- resources/ro_node/meta.yaml | 1 + solar/solar/core/signals.py | 17 +++++------------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/resources/ro_node/meta.yaml b/resources/ro_node/meta.yaml index 1f762669..3339a0b4 100644 --- a/resources/ro_node/meta.yaml +++ b/resources/ro_node/meta.yaml @@ -18,3 +18,4 @@ input: location_id: schema: str! value: $uuid + reverse: True diff --git a/solar/solar/core/signals.py b/solar/solar/core/signals.py index e01a8754..baf1441a 100644 --- a/solar/solar/core/signals.py +++ b/solar/solar/core/signals.py @@ -64,23 +64,16 @@ def location_and_transports(emitter, receiver, orig_mapping): print emitter_single, receiver_single # connect in other direction if emitter_single_reverse: + if receiver_single_reverse: + connect_single(receiver, single, emitter, single) + _remove_from_mapping(single) + return + if receiver_single_reverse: connect_single(receiver, single, emitter, single) _remove_from_mapping(single) return if isinstance(orig_mapping, dict): orig_mapping[single] = single - # if we have reverse then do it in reverse way - # if emitter_single.get('reverse'): - # connect_single(receiver, single, emitter, single) - # # maybe already connected somewhere, then don't create this relation - # if not emitter.resource_inputs()[single].backtrack_value(): - # connect_single(receiver, single, emitter, single) - # elif not receiver_single.get('reverse', False): - # # maybe already connected somewhere, then don't create this relation - # if not receiver.resource_inputs()[single].backtrack_value(): - # if isinstance(orig_mapping, dict): - # orig_mapping[single] = single - for single in ('transports_id', 'location_id'): _single(single) return