From 68282b6ffed904bb55700314a600fe5d731dd0ea Mon Sep 17 00:00:00 2001 From: jblum Date: Wed, 4 Feb 2009 23:03:47 +0000 Subject: nicer display formatting, and use of eng notation git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10391 221aa14e-8319-0410-a670-987f0aec2ac5 --- grc/src/platforms/base/Param.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'grc/src/platforms/base') 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. -- cgit