commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 06/10: grc: evaluate cheetah template to re


From: git
Subject: [Commit-gnuradio] [gnuradio] 06/10: grc: evaluate cheetah template to resolve 'optional' tag in port definition
Date: Mon, 13 Feb 2017 00:34:50 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch maint
in repository gnuradio.

commit 88445d0d3511528ddddb5eb2c37a7739edff534b
Author: Sean Nowlan <address@hidden>
Date:   Thu Feb 2 14:15:39 2017 -0500

    grc: evaluate cheetah template to resolve 'optional' tag in port definition
---
 grc/core/Port.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/grc/core/Port.py b/grc/core/Port.py
index f740a69..acf4eea 100644
--- a/grc/core/Port.py
+++ b/grc/core/Port.py
@@ -168,7 +168,8 @@ class Port(Element):
 
         self._nports = n.find('nports') or ''
         self._vlen = n.find('vlen') or ''
-        self._optional = bool(n.find('optional'))
+        self._optional = n.find('optional') or ''
+        self._optional_evaluated = False  # Updated on rewrite()
         self._clones = []  # References to cloned ports (for nports > 1)
 
     def __str__(self):
@@ -208,6 +209,8 @@ class Port(Element):
 
         hide = 
self.get_parent().resolve_dependencies(self._hide).strip().lower()
         self._hide_evaluated = False if hide in ('false', 'off', '0') else 
bool(hide)
+        optional = 
self.get_parent().resolve_dependencies(self._optional).strip().lower()
+        self._optional_evaluated = False if optional in ('false', 'off', '0') 
else bool(optional)
 
         # Update domain if was deduced from (dynamic) port type
         type_ = self.get_type()
@@ -272,7 +275,7 @@ class Port(Element):
             return 1
 
     def get_optional(self):
-        return bool(self._optional)
+        return self._optional_evaluated
 
     def get_color(self):
         """



reply via email to

[Prev in Thread] Current Thread [Next in Thread]