3
# Copyright (C) 2002 by the Free Software Foundation, Inc.
5
# This program is free software; you can redistribute it and/or
6
# modify it under the terms of the GNU General Public License
7
# as published by the Free Software Foundation; either version 2
8
# of the License, or (at your option) any later version.
10
# This program is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
15
# You should have received a copy of the GNU General Public License
16
# along with this program; if not, write to the Free Software
17
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
"""Convert a list's interpolation strings from %-strings to $-strings.
21
This script is intended to be run as a bin/withlist script, i.e.
23
% bin/withlist -l -r convert <mylist>
27
from Mailman import Utils
28
from Mailman.i18n import _
31
for attr in ('msg_header', 'msg_footer', 'digest_header', 'digest_footer',
32
'autoresponse_postings_text', 'autoresponse_admin_text',
33
'autoresponse_request_text'):
34
s = getattr(mlist, attr)
35
t = Utils.to_dollar(s)
36
setattr(mlist, attr, t)
37
mlist.use_dollar_strings = 1
38
print _('Saving list')
43
if __name__ == '__main__':
44
print _(__doc__.replace('%', '%%'))