summaryrefslogtreecommitdiff
path: root/grc/python
diff options
context:
space:
mode:
Diffstat (limited to 'grc/python')
-rw-r--r--grc/python/Block.py4
-rw-r--r--grc/python/Connection.py7
-rw-r--r--grc/python/FlowGraph.py7
-rw-r--r--grc/python/Param.py18
-rw-r--r--grc/python/Platform.py4
-rw-r--r--grc/python/Port.py4
6 files changed, 30 insertions, 14 deletions
diff --git a/grc/python/Block.py b/grc/python/Block.py
index 2df2049a4..dd39b095d 100644
--- a/grc/python/Block.py
+++ b/grc/python/Block.py
@@ -18,10 +18,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
from .. base.Block import Block as _Block
+from .. gui.Block import Block as _GUIBlock
import extract_docs
import extract_category
-class Block(_Block):
+class Block(_Block, _GUIBlock):
def is_virtual_sink(self): return self.get_key() == 'virtual_sink'
def is_virtual_source(self): return self.get_key() == 'virtual_source'
@@ -51,6 +52,7 @@ class Block(_Block):
flow_graph=flow_graph,
n=n,
)
+ _GUIBlock.__init__(self)
def validate(self):
"""
diff --git a/grc/python/Connection.py b/grc/python/Connection.py
index 85b5b2c52..edc18841a 100644
--- a/grc/python/Connection.py
+++ b/grc/python/Connection.py
@@ -18,8 +18,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
from .. base.Connection import Connection as _Connection
+from .. gui.Connection import Connection as _GUIConnection
-class Connection(_Connection):
+class Connection(_Connection, _GUIConnection):
+
+ def __init__(self, **kwargs):
+ _Connection.__init__(self, **kwargs)
+ _GUIConnection.__init__(self)
def is_msg(self):
return self.get_source().get_type() == self.get_sink().get_type() == 'msg'
diff --git a/grc/python/FlowGraph.py b/grc/python/FlowGraph.py
index 8cad8be49..96188b816 100644
--- a/grc/python/FlowGraph.py
+++ b/grc/python/FlowGraph.py
@@ -19,6 +19,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
import expr_utils
from .. base.FlowGraph import FlowGraph as _FlowGraph
+from .. gui.FlowGraph import FlowGraph as _GUIFlowGraph
from Block import Block
from Connection import Connection
import re
@@ -26,7 +27,11 @@ import re
_variable_matcher = re.compile('^(variable\w*)$')
_parameter_matcher = re.compile('^(parameter)$')
-class FlowGraph(_FlowGraph):
+class FlowGraph(_FlowGraph, _GUIFlowGraph):
+
+ def __init__(self, **kwargs):
+ _FlowGraph.__init__(self, **kwargs)
+ _GUIFlowGraph.__init__(self)
_eval_cache = dict()
def _eval(self, code, namespace, namespace_hash):
diff --git a/grc/python/Param.py b/grc/python/Param.py
index d574b513e..17cfad051 100644
--- a/grc/python/Param.py
+++ b/grc/python/Param.py
@@ -18,7 +18,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
import expr_utils
-from .. base.Param import Param as _Param, EntryParam
+from .. base.Param import Param as _Param
+from .. gui.Param import Param as _GUIParam
+from .. gui.Param import EntryParam
import Constants
import numpy
import os
@@ -83,14 +85,11 @@ COMPLEX_TYPES = tuple(COMPLEX_TYPES + REAL_TYPES + INT_TYPES)
REAL_TYPES = tuple(REAL_TYPES + INT_TYPES)
INT_TYPES = tuple(INT_TYPES)
-class Param(_Param):
+class Param(_Param, _GUIParam):
- def __init__(self, block, n):
- _Param.__init__(
- self,
- block=block,
- n=n,
- )
+ def __init__(self, **kwargs):
+ _Param.__init__(self, **kwargs)
+ _GUIParam.__init__(self)
self._init = False
self._hostage_cells = list()
@@ -156,7 +155,7 @@ class Param(_Param):
def get_input_class(self):
if self.get_type() in ('file_open', 'file_save'): return FileParam
- return _Param.get_input_class(self)
+ return _GUIParam.get_input_class(self)
def get_color(self):
"""
@@ -178,6 +177,7 @@ class Param(_Param):
'hex': Constants.INT_COLOR_SPEC,
'string': Constants.BYTE_VECTOR_COLOR_SPEC,
'id': Constants.ID_COLOR_SPEC,
+ 'stream_id': Constants.ID_COLOR_SPEC,
'grid_pos': Constants.INT_VECTOR_COLOR_SPEC,
'notebook': Constants.INT_VECTOR_COLOR_SPEC,
'raw': Constants.WILDCARD_COLOR_SPEC,
diff --git a/grc/python/Platform.py b/grc/python/Platform.py
index cab25d348..bb56d361b 100644
--- a/grc/python/Platform.py
+++ b/grc/python/Platform.py
@@ -20,6 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
import os
from gnuradio import gr
from .. base.Platform import Platform as _Platform
+from .. gui.Platform import Platform as _GUIPlatform
from FlowGraph import FlowGraph as _FlowGraph
from Connection import Connection as _Connection
from Block import Block as _Block
@@ -46,7 +47,7 @@ COLORS = (#title, #color spec
('Message', Constants.MSG_COLOR_SPEC),
)
-class Platform(_Platform):
+class Platform(_Platform, _GUIPlatform):
def __init__(self):
"""
@@ -70,6 +71,7 @@ class Platform(_Platform):
generator=Generator,
colors=COLORS,
)
+ _GUIPlatform.__init__(self)
##############################################
# Constructors
diff --git a/grc/python/Port.py b/grc/python/Port.py
index a714844ef..33426d905 100644
--- a/grc/python/Port.py
+++ b/grc/python/Port.py
@@ -18,6 +18,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
from .. base.Port import Port as _Port
+from .. gui.Port import Port as _GUIPort
import Constants
def _get_source_from_virtual_sink_port(vsp):
@@ -49,7 +50,7 @@ def _get_source_from_virtual_source_port(vsp, traversed=[]):
)
except: raise Exception, 'Could not resolve source for virtual source port %s'%vsp
-class Port(_Port):
+class Port(_Port, _GUIPort):
def __init__(self, block, n, dir):
"""
@@ -73,6 +74,7 @@ class Port(_Port):
n=n,
dir=dir,
)
+ _GUIPort.__init__(self)
self._nports = n.find('nports') or ''
self._vlen = n.find('vlen') or ''
self._optional = bool(n.find('optional'))