From 63c928575c10741ac6a6c3c3c8be9c238e7b8432 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 17 Aug 2009 00:54:11 -0700 Subject: Removed Source and Sink classes as Port subclasses. A port can be a source or a sink based on the dir parameter. --- grc/gui/Platform.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'grc/gui/Platform.py') diff --git a/grc/gui/Platform.py b/grc/gui/Platform.py index a32b0209f..1530a69d6 100644 --- a/grc/gui/Platform.py +++ b/grc/gui/Platform.py @@ -1,5 +1,5 @@ """ -Copyright 2008 Free Software Foundation, Inc. +Copyright 2008, 2009 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or @@ -38,8 +38,7 @@ def Platform(platform): ('FlowGraph', FlowGraph), ('Connection', Connection), ('Block', Block), - ('Source', Port), - ('Sink', Port), + ('Port', Port), ('Param', Param), ): old_value = getattr(platform, attr) -- cgit From 152fcbc219cd2e4f6df7b38843844bc85fdf2bc2 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 30 Aug 2009 10:34:10 -0700 Subject: Switched the python classes to inherit from the base and gui classes. Use only **kwargs so all contructor parameters must be passed with keys. Moved gui input forms classes from base to gui param module. --- grc/gui/Platform.py | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) (limited to 'grc/gui/Platform.py') diff --git a/grc/gui/Platform.py b/grc/gui/Platform.py index 1530a69d6..8f0aa533d 100644 --- a/grc/gui/Platform.py +++ b/grc/gui/Platform.py @@ -17,31 +17,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA """ -from FlowGraph import FlowGraph -from Connection import Connection -from Block import Block -from Port import Port -from Param import Param +from Element import Element -def conjoin_classes(name, c1, c2): - exec(""" -class %s(c1, c2): - def __init__(self, *args, **kwargs): - c1.__init__(self, *args, **kwargs) - c2.__init__(self, *args, **kwargs) -"""%name, locals()) - return locals()[name] - -def Platform(platform): - #combine with gui class - for attr, value in ( - ('FlowGraph', FlowGraph), - ('Connection', Connection), - ('Block', Block), - ('Port', Port), - ('Param', Param), - ): - old_value = getattr(platform, attr) - c = conjoin_classes(attr, old_value, value) - setattr(platform, attr, c) - return platform +class Platform(Element): pass -- cgit From 5f54b018b3a84ba4b68009a1c326ba73eaea8cfd Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sat, 5 Sep 2009 01:54:41 -0700 Subject: standardized the Element inheritance __init__ usage in gui --- grc/gui/Platform.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'grc/gui/Platform.py') diff --git a/grc/gui/Platform.py b/grc/gui/Platform.py index 8f0aa533d..8bbfaca23 100644 --- a/grc/gui/Platform.py +++ b/grc/gui/Platform.py @@ -19,4 +19,5 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA from Element import Element -class Platform(Element): pass +class Platform(Element): + def __init__(self): Element.__init__(self) -- cgit