From ea8a9164c25df9e05e656d9ee4c12542c8f99a71 Mon Sep 17 00:00:00 2001 From: James Troup Date: Wed, 21 Mar 2001 01:02:04 +0000 Subject: [PATCH] Add TemplateSubst. --- utils.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/utils.py b/utils.py index 66d28416..b45a7454 100644 --- a/utils.py +++ b/utils.py @@ -1,6 +1,6 @@ # Utility functions # Copyright (C) 2000 James Troup -# $Id: utils.py,v 1.17 2001-03-02 02:46:57 troup Exp $ +# $Id: utils.py,v 1.18 2001-03-21 01:02:04 troup Exp $ # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -360,6 +360,14 @@ def regex_safe (s): ###################################################################################### +# Perform a substition of template +def TemplateSubst(Map,Template): + for x in Map.keys(): + Template = string.replace(Template,x,Map[x]); + return Template; + +###################################################################################### + def size_type (c): t = " b"; if c > 10000: -- 2.39.5