From 3d322e9ce4083137377fe8798accc91c8dc8bb67 Mon Sep 17 00:00:00 2001 From: Sebastian Koslowski <koslowski@kit.edu> Date: Wed, 20 Jul 2016 13:44:42 +0200 Subject: grc: refactor: class for nports port clones --- grc/core/Platform.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'grc/core/Platform.py') diff --git a/grc/core/Platform.py b/grc/core/Platform.py index 696281380e..997631d2c1 100644 --- a/grc/core/Platform.py +++ b/grc/core/Platform.py @@ -33,7 +33,7 @@ from .generator import Generator from .FlowGraph import FlowGraph from .Connection import Connection from .Block import Block, EPyBlock -from .Port import Port +from .Port import Port, PortClone from .Param import Param from .utils import extract_docs @@ -318,6 +318,7 @@ class Platform(Element): } port_classes = { None: Port, # default + 'clone': PortClone, # default } param_classes = { None: Param, # default @@ -333,9 +334,9 @@ class Platform(Element): return cls(parent, key=key, **kwargs) def get_new_param(self, parent, **kwargs): - cls = self.param_classes[None] + cls = self.param_classes[kwargs.pop('cls_key', None)] return cls(parent, **kwargs) def get_new_port(self, parent, **kwargs): - cls = self.port_classes[None] - return cls(parent, **kwargs) \ No newline at end of file + cls = self.port_classes[kwargs.pop('cls_key', None)] + return cls(parent, **kwargs) -- cgit v1.2.3