diff options
Diffstat (limited to 'grc')
-rw-r--r-- | grc/core/FlowGraph.py | 6 | ||||
-rw-r--r-- | grc/core/Platform.py | 2 | ||||
-rw-r--r-- | grc/gui/Connection.py | 8 | ||||
-rw-r--r-- | 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 8246d86f44..18a5778015 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 2a8764ad0d..9956391055 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 b1ae32ddcc..949840401e 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 d57323988f..5cd575dabe 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 |