~mailman-coders/mailman/2.1

1 by
This commit was manufactured by cvs2svn to create branch
1
#! @PYTHON@
2
#
1779 by Mark Sapiro
Bump copyright dates.
3
# Copyright (C) 2002-2018 by the Free Software Foundation, Inc.
1 by
This commit was manufactured by cvs2svn to create branch
4
#
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.
9
# 
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.
14
# 
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 
749 by tkikuchi
FSF office has moved to 51 Franklin Street.
17
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1 by
This commit was manufactured by cvs2svn to create branch
18
19
"""Convert a list's interpolation strings from %-strings to $-strings.
20
21
This script is intended to be run as a bin/withlist script, i.e.
22
23
% bin/withlist -l -r convert <mylist>
24
"""
25
26
import paths
27
from Mailman import Utils
1619.1.1 by Yasuhito FUTATSUKI at POEM
Importing locale patch for command line utils, from RHEL6 rpm source
28
from Mailman.i18n import C_
1 by
This commit was manufactured by cvs2svn to create branch
29
30
def convert(mlist):
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
1619.1.1 by Yasuhito FUTATSUKI at POEM
Importing locale patch for command line utils, from RHEL6 rpm source
38
    print C_('Saving list')
1 by
This commit was manufactured by cvs2svn to create branch
39
    mlist.Save()
40
41
42

43
if __name__ == '__main__':
1619.1.1 by Yasuhito FUTATSUKI at POEM
Importing locale patch for command line utils, from RHEL6 rpm source
44
    print C_(__doc__.replace('%', '%%'))