summaryrefslogtreecommitdiff
path: root/grc/src/platforms/base
diff options
context:
space:
mode:
authorjblum2009-02-04 23:03:47 +0000
committerjblum2009-02-04 23:03:47 +0000
commit68282b6ffed904bb55700314a600fe5d731dd0ea (patch)
treeae0ac23e82788e2568761677adc6b5a6cce07c9f /grc/src/platforms/base
parentf21c7b1eeed46a2edf5b082d86d5386790e99f98 (diff)
downloadgnuradio-68282b6ffed904bb55700314a600fe5d731dd0ea.tar.gz
gnuradio-68282b6ffed904bb55700314a600fe5d731dd0ea.tar.bz2
gnuradio-68282b6ffed904bb55700314a600fe5d731dd0ea.zip
nicer display formatting, and use of eng notation
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10391 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'grc/src/platforms/base')
-rw-r--r--grc/src/platforms/base/Param.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/grc/src/platforms/base/Param.py b/grc/src/platforms/base/Param.py
index 6f512cb87..ebc9977fc 100644
--- a/grc/src/platforms/base/Param.py
+++ b/grc/src/platforms/base/Param.py
@@ -228,6 +228,16 @@ class Param(Element):
def get_type(self): return self.get_parent().resolve_dependencies(self._type)
def is_enum(self): return bool(self.get_options())
+ def __repr__(self):
+ """
+ Get the repr (nice string format) for this param.
+ Just return the value (special case enum).
+ Derived classes can handle complex formatting.
+ @return the string representation
+ """
+ if self.is_enum(): return self.get_option(self.get_value()).get_name()
+ return self.get_value()
+
def get_input_class(self):
"""
Get the graphical gtk class to represent this parameter.