[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 62/101: grc: refactor: handle flowgraph and
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 62/101: grc: refactor: handle flowgraph and connection super init same as in block |
Date: |
Thu, 16 Mar 2017 14:58:07 +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 52dadbf46f16b682348a6969a782ff64a129d9f8
Author: Sebastian Koslowski <address@hidden>
Date: Sun Jul 31 21:13:17 2016 +0200
grc: refactor: handle flowgraph and connection super init same as in block
---
grc/core/FlowGraph.py | 6 +++---
grc/core/Platform.py | 2 +-
grc/gui/Connection.py | 8 ++++----
grc/gui/FlowGraph.py | 9 +++++----
4 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/grc/core/FlowGraph.py b/grc/core/FlowGraph.py
index 8246d86..18a5778 100644
--- a/grc/core/FlowGraph.py
+++ b/grc/core/FlowGraph.py
@@ -40,17 +40,17 @@ class FlowGraph(Element):
is_flow_graph = True
- def __init__(self, platform):
+ def __init__(self, parent):
"""
Make a flow graph from the arguments.
Args:
- platform: a platforms with blocks and contrcutors
+ parent: a platforms with blocks and element factories
Returns:
the flow graph object
"""
- Element.__init__(self, parent=platform)
+ Element.__init__(self, parent)
self._timestamp = time.ctime()
self._options_block = self.parent_platform.get_new_block(self,
'options')
diff --git a/grc/core/Platform.py b/grc/core/Platform.py
index 2a8764a..9956391 100644
--- a/grc/core/Platform.py
+++ b/grc/core/Platform.py
@@ -326,7 +326,7 @@ class Platform(Element):
}
def get_new_flow_graph(self):
- return self.FlowGraph(platform=self)
+ return self.FlowGraph(parent=self)
def get_new_block(self, parent, key, **kwargs):
cls = self.block_classes.get(key, self.block_classes[None])
diff --git a/grc/gui/Connection.py b/grc/gui/Connection.py
index b1ae32d..9498404 100644
--- a/grc/gui/Connection.py
+++ b/grc/gui/Connection.py
@@ -24,10 +24,10 @@ from .Constants import CONNECTOR_ARROW_BASE,
CONNECTOR_ARROW_HEIGHT
from .Element import Element
from ..core.Element import nop_write
-from ..core.Connection import Connection as _Connection
+from ..core.Connection import Connection as CoreConnection
-class Connection(Element, _Connection):
+class Connection(CoreConnection, Element):
"""
A graphical connection for ports.
The connection has 2 parts, the arrow and the wire.
@@ -38,8 +38,8 @@ class Connection(Element, _Connection):
"""
def __init__(self, *args, **kwargs):
+ super(self.__class__, self).__init__(*args, **kwargs)
Element.__init__(self)
- _Connection.__init__(self, *args, **kwargs)
self._color = self._color2 = self._arrow_color = None
@@ -64,7 +64,7 @@ class Connection(Element, _Connection):
return 0
def create_shapes(self):
- """Precalculate relative coordinates."""
+ """Pre-calculate relative coordinates."""
Element.create_shapes(self)
self._sink_rot = None
self._source_rot = None
diff --git a/grc/gui/FlowGraph.py b/grc/gui/FlowGraph.py
index d573239..5cd575d 100644
--- a/grc/gui/FlowGraph.py
+++ b/grc/gui/FlowGraph.py
@@ -34,24 +34,25 @@ from . import Actions, Colors, Utils, Bars, Dialogs
from .Element import Element
from .external_editor import ExternalEditor
-from ..core.FlowGraph import FlowGraph as _Flowgraph
+from ..core.FlowGraph import FlowGraph as CoreFlowgraph
from ..core import Messages
-class FlowGraph(Element, _Flowgraph):
+class FlowGraph(CoreFlowgraph, Element):
"""
FlowGraph is the data structure to store graphical signal blocks,
graphical inputs and outputs,
and the connections between inputs and outputs.
"""
- def __init__(self, **kwargs):
+ def __init__(self, parent, **kwargs):
"""
FlowGraph constructor.
Create a list for signal blocks and connections. Connect mouse
handlers.
"""
+ super(self.__class__, self).__init__(parent, **kwargs)
Element.__init__(self)
- _Flowgraph.__init__(self, **kwargs)
+ self.drawing_area = None
# important vars dealing with mouse event tracking
self.element_moved = False
self.mouse_pressed = False
- [Commit-gnuradio] [gnuradio] 32/101: grc: refactor: remote port domain getter, (continued)
- [Commit-gnuradio] [gnuradio] 32/101: grc: refactor: remote port domain getter, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 16/101: Merge remote-tracking branch 'grcwg/next_grcwg' into gtk3, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 57/101: grc: gtk3: remove left-over gtk2 usage in generator template, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 43/101: grc: refactor: minor clean-up and fixes, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 44/101: grc: gtk3: fix connection arrows, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 56/101: grc: gtk3: fix generating virtual/bypassed connections, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 46/101: grc: dynamic super-classing proof-of-concept =), git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 53/101: grc: make dummy blocks a block subclass, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 68/101: grc: add error messages iterator, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 64/101: grc: gtk3: better lables/shapes handling during flowgraph update, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 62/101: grc: refactor: handle flowgraph and connection super init same as in block,
git <=
- [Commit-gnuradio] [gnuradio] 65/101: grc: gtk3: dashed lines for message connections, thicker ones for custom domains, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 54/101: grc: refactor: replace get_enabled by prop, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 67/101: grc: remove support for old msg queues, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 60/101: grc: gtk3: update various deprecated gtk calls, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 52/101: grc: refactor: remove get for port and param name, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 40/101: grc: gtk3: remove coordinate getter/setter, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 69/101: grc: gtk3: use darkened bg color for port border, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 55/101: grc: various clean-ups and fixes, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 48/101: grc: refactor: class for nports port clones, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 49/101: grc: refactor: some more bus ports stuff, git, 2017/03/16