From: James Troup Date: Wed, 21 Mar 2001 01:02:04 +0000 (+0000) Subject: Add TemplateSubst. X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=ea8a9164c25df9e05e656d9ee4c12542c8f99a71;p=dak.git Add TemplateSubst. --- 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: