summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbwarsaw2002-11-18 06:13:10 +0000
committerbwarsaw2002-11-18 06:13:10 +0000
commit0d1ba8239d1084aa8a664e3996bfa2200f10f866 (patch)
tree303b4310dfbf64692204b853a7c5f2c9655758a8
parentc328d5d4e535dc8c89dfd3a2a20cd438e68d3611 (diff)
downloadmailman-0d1ba8239d1084aa8a664e3996bfa2200f10f866.tar.gz
mailman-0d1ba8239d1084aa8a664e3996bfa2200f10f866.tar.zst
mailman-0d1ba8239d1084aa8a664e3996bfa2200f10f866.zip
SafeDict.interpolate(): Added for convenience.
-rw-r--r--Mailman/SafeDict.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/Mailman/SafeDict.py b/Mailman/SafeDict.py
index d5f2c5705..37b5198a7 100644
--- a/Mailman/SafeDict.py
+++ b/Mailman/SafeDict.py
@@ -1,17 +1,17 @@
-# Copyright (C) 1998,1999,2000,2001 by the Free Software Foundation, Inc.
+# Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc.
#
# 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 the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
+# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
"""A `safe' dictionary for string interpolation."""
@@ -37,6 +37,9 @@ class SafeDict(UserDict):
else:
return '<Missing key: %s>' % `key`
+ def interpolate(self, template):
+ return template % self
+
class MsgSafeDict(SafeDict):