commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 56/101: grc: gtk3: fix generating virtual/b


From: git
Subject: [Commit-gnuradio] [gnuradio] 56/101: grc: gtk3: fix generating virtual/bypassed connections
Date: Thu, 16 Mar 2017 14:58:06 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch python3
in repository gnuradio.

commit 0417d966ab328b51c0cdfeb5d8920cbbcd69c9de
Author: Sebastian Koslowski <address@hidden>
Date:   Fri Jul 29 15:42:31 2016 +0200

    grc: gtk3: fix generating virtual/bypassed connections
---
 grc/core/generator/FlowGraphProxy.py | 6 +++---
 grc/core/generator/Generator.py      | 6 +++---
 grc/gui/Connection.py                | 4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/grc/core/generator/FlowGraphProxy.py 
b/grc/core/generator/FlowGraphProxy.py
index 678be44..23ccf95 100644
--- a/grc/core/generator/FlowGraphProxy.py
+++ b/grc/core/generator/FlowGraphProxy.py
@@ -20,13 +20,13 @@ from __future__ import absolute_import
 from six.moves import range
 
 
-class FlowGraphProxy(object):
+class FlowGraphProxy(object):  # TODO: move this in a refactored Generator
 
     def __init__(self, fg):
-        self._fg = fg
+        self.orignal_flowgraph = fg
 
     def __getattr__(self, item):
-        return getattr(self._fg, item)
+        return getattr(self.orignal_flowgraph, item)
 
     def get_hier_block_stream_io(self, direction):
         """
diff --git a/grc/core/generator/Generator.py b/grc/core/generator/Generator.py
index 7c9a1ec..a3b0c8a 100644
--- a/grc/core/generator/Generator.py
+++ b/grc/core/generator/Generator.py
@@ -171,11 +171,12 @@ class TopBlockGenerator(object):
         connections = [con for con in fg.get_enabled_connections() if cf(con)]
 
         # Get the virtual blocks and resolve their connections
+        connection_factory = fg.parent_platform.Connection
         virtual = [c for c in connections if 
c.source_block.is_virtual_source()]
         for connection in virtual:
             source = connection.source_port.resolve_virtual_source()
             sink = connection.sink_port
-            resolved = fg.parent.Connection(flow_graph=fg, porta=source, 
portb=sink)
+            resolved = connection_factory(fg.orignal_flowgraph, source, sink)
             connections.append(resolved)
             # Remove the virtual connection
             connections.remove(connection)
@@ -201,8 +202,7 @@ class TopBlockGenerator(object):
                 if not sink.enabled:
                     # Ignore disabled connections
                     continue
-                sink_port = sink.sink_port
-                connection = fg.parent.Connection(flow_graph=fg, 
porta=source_port, portb=sink_port)
+                connection = connection_factory(fg.orignal_flowgraph, 
source_port, sink.sink_port)
                 connections.append(connection)
                 # Remove this sink connection
                 connections.remove(sink)
diff --git a/grc/gui/Connection.py b/grc/gui/Connection.py
index 9b48338..1c00845 100644
--- a/grc/gui/Connection.py
+++ b/grc/gui/Connection.py
@@ -37,9 +37,9 @@ class Connection(Element, _Connection):
     The arrow coloring exposes the enabled and valid states.
     """
 
-    def __init__(self, **kwargs):
+    def __init__(self, *args, **kwargs):
         Element.__init__(self)
-        _Connection.__init__(self, **kwargs)
+        _Connection.__init__(self, *args, **kwargs)
 
         self._color = self._color2 = self._arrow_color = None
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]