diff options
author | Josh Blum <josh@joshknows.com> | 2010-03-23 23:39:05 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-03-23 23:39:05 -0700 |
commit | 96a20bb09dc6b07b3d2651645e579dff6c3f3a45 (patch) | |
tree | e64aacde292835604761a5b06b94fc8eddf56fae /grc/gui | |
parent | 1ae689ff9238dcffbf65881b8ca03aa8df3844aa (diff) |
work on the string representations for parameters (large vectors could be too much to render, ie use truncation)
Diffstat (limited to 'grc/gui')
-rw-r--r-- | grc/gui/Param.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/grc/gui/Param.py b/grc/gui/Param.py index b3018dab21..7c00c1b67f 100644 --- a/grc/gui/Param.py +++ b/grc/gui/Param.py @@ -1,5 +1,5 @@ """ -Copyright 2007, 2008, 2009 Free Software Foundation, Inc. +Copyright 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or @@ -135,10 +135,21 @@ PARAM_LABEL_MARKUP_TMPL="""\ <span underline="$underline" foreground="$foreground" font_desc="Sans 9">$encode($param.get_name())</span>""" TIP_MARKUP_TMPL="""\ +######################################## +#def truncate(string) + #set $max_len = 100 + #set $string = str($string) + #if len($string) > $max_len +$('%s...%s'%($string[:$max_len/2], $string[-$max_len/2:]))#slurp + #else +$string#slurp + #end if +#end def +######################################## Key: $param.get_key() Type: $param.get_type() #if $param.is_valid() -Value: $param.get_evaluated() +Value: $truncate($param.get_evaluated()) #elif len($param.get_error_messages()) == 1 Error: $(param.get_error_messages()[0]) #else |