diff options
author | jblum <jblum@221aa14e-8319-0410-a670-987f0aec2ac5> | 2009-05-01 20:28:04 +0000 |
---|---|---|
committer | jblum <jblum@221aa14e-8319-0410-a670-987f0aec2ac5> | 2009-05-01 20:28:04 +0000 |
commit | a3ba8cf268816af51c4bb39ea7ecd7e85ea0807b (patch) | |
tree | 21dbd446e92672a56b323e005088d3c03edc238f /grc/src/platforms/gui/Utils.py | |
parent | 6ce881caaacdd60a8bea37584c7286e08bea97a7 (diff) |
Merged grc developer branch r10679:10938
Misc fixes and internal changes.
Added help menu for usage tips.
Added drag and drop for blocks.
Removed callback controls, adopted forms.
Any type can have enumerated options.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10941 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'grc/src/platforms/gui/Utils.py')
-rw-r--r-- | grc/src/platforms/gui/Utils.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/grc/src/platforms/gui/Utils.py b/grc/src/platforms/gui/Utils.py index 17750ef45b..ee6dc6cdc4 100644 --- a/grc/src/platforms/gui/Utils.py +++ b/grc/src/platforms/gui/Utils.py @@ -1,5 +1,5 @@ """ -Copyright 2008 Free Software Foundation, Inc. +Copyright 2008, 2009 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or @@ -18,6 +18,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA """ from Constants import POSSIBLE_ROTATIONS +from Cheetah.Template import Template def get_rotated_coordinate(coor, rotation): """ @@ -69,3 +70,13 @@ def xml_encode(string): ("'", '''), ): string = string.replace(char, safe) return string + +def parse_template(tmpl_str, **kwargs): + """ + Parse the template string with the given args. + Pass in the xml encode method for pango escape chars. + @param tmpl_str the template as a string + @return a string of the parsed template + """ + kwargs['encode'] = xml_encode + return str(Template(tmpl_str, kwargs)) |