From eb40a41ec28d5f8320d9c0abcb7a2aa2602b9872 Mon Sep 17 00:00:00 2001
From: Sebastian Koslowski <koslowski@kit.edu>
Date: Fri, 5 Dec 2014 10:24:08 +0100
Subject: grc: add gr_message domain

---
 grc/python/Port.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

(limited to 'grc/python/Port.py')

diff --git a/grc/python/Port.py b/grc/python/Port.py
index cfeabf8560..fdeb14a4a6 100644
--- a/grc/python/Port.py
+++ b/grc/python/Port.py
@@ -18,9 +18,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 """
 
 from .. base.Port import Port as _Port
+from .. base.Constants import DEFAULT_DOMAIN, GR_MESSAGE_DOMAIN
 from .. gui.Port import Port as _GUIPort
 import Constants
 
+
 def _get_source_from_virtual_sink_port(vsp):
     """
     Resolve the source port that is connected to the given virtual sink port.
@@ -91,8 +93,14 @@ class Port(_Port, _GUIPort):
             dir: the direction
         """
         self._n = n
+        if n['type'] == 'message':
+            n['domain'] = GR_MESSAGE_DOMAIN
+        if 'domain' not in n:
+            n['domain'] = DEFAULT_DOMAIN
+        elif n['domain'] == GR_MESSAGE_DOMAIN:
+            n['key'] = n['name']
+            n['type'] = 'message'  # for port color
         if n['type'] == 'msg': n['key'] = 'msg'
-        if n['type'] == 'message': n['key'] = n['name']
         if dir == 'source' and not n.find('key'):
             n['key'] = str(block._source_count)
             block._source_count += 1
-- 
cgit v1.2.3