diff options
Diffstat (limited to 'grc/gui/Utils.py')
-rw-r--r-- | grc/gui/Utils.py | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/grc/gui/Utils.py b/grc/gui/Utils.py index 054af57c51..e5d69bcf54 100644 --- a/grc/gui/Utils.py +++ b/grc/gui/Utils.py @@ -25,8 +25,6 @@ from gi.repository import GdkPixbuf from gi.repository import GObject from gi.repository import GLib -from Cheetah.Template import Template - from Constants import POSSIBLE_ROTATIONS, CANVAS_GRID_SIZE @@ -104,28 +102,6 @@ def encode(value): return GLib.markup_escape_text(valid_utf8) -class TemplateParser(object): - def __init__(self): - self.cache = {} - - def __call__(self, tmpl_str, **kwargs): - """ - Parse the template string with the given args. - Pass in the xml encode method for pango escape chars. - - Args: - tmpl_str: the template as a string - - Returns: - a string of the parsed template - """ - kwargs['encode'] = encode - template = self.cache.setdefault(tmpl_str, Template.compile(tmpl_str)) - return str(template(namespaces=kwargs)) - -parse_template = TemplateParser() - - def align_to_grid(coor, mode=round): def align(value): return int(mode(value / (1.0 * CANVAS_GRID_SIZE)) * CANVAS_GRID_SIZE) |