diff options
author | jblum | 2009-02-04 23:03:47 +0000 |
---|---|---|
committer | jblum | 2009-02-04 23:03:47 +0000 |
commit | 68282b6ffed904bb55700314a600fe5d731dd0ea (patch) | |
tree | ae0ac23e82788e2568761677adc6b5a6cce07c9f /grc/src/platforms/base | |
parent | f21c7b1eeed46a2edf5b082d86d5386790e99f98 (diff) | |
download | gnuradio-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.py | 10 |
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. |