/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to tools/build_mo.py

  • Committer: Andrew Bennetts
  • Date: 2011-06-09 07:38:32 UTC
  • mto: This revision was merged to the branch mainline in revision 5964.
  • Revision ID: andrew.bennetts@canonical.com-20110609073832-dt6oww033iexli4l
Fix thinko in wording regarding stacking invariants and revisions with multiple parents.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# -*- coding: utf-8 -*-
2
2
#
3
 
# Copyright (C) 2007, 2009, 2011 Canonical Ltd.
 
3
# Copyright (C) 2007 Lukáš Lalinský <lalinsky@gmail.com>
 
4
# Copyright (C) 2007,2009 Alexander Belchenko <bialix@ukr.net>
 
5
# Copyright 2011 Canonical Ltd.
4
6
#
5
 
# This program is free software; you can redistribute it and/or modify
6
 
# it under the terms of the GNU General Public License as published by
7
 
# the Free Software Foundation; either version 2 of the License, or
8
 
# (at your option) any later version.
 
7
# This program is free software; you can redistribute it and/or
 
8
# modify it under the terms of the GNU General Public License
 
9
# as published by the Free Software Foundation; either version 2
 
10
# of the License, or (at your option) any later version.
9
11
#
10
12
# This program is distributed in the hope that it will be useful,
11
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
16
#
15
17
# You should have received a copy of the GNU General Public License
16
18
# along with this program; if not, write to the Free Software
17
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
19
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18
20
 
19
 
# This code is from bzr-explorer and modified for bzr.
 
21
# This code is bring from bzr-explorer and modified for bzr.
20
22
 
21
23
"""build_mo command for setup.py"""
22
24
 
43
45
                    ('force', 'f', 'Force creation of mo files'),
44
46
                    ('lang=', None, 'Comma-separated list of languages '
45
47
                                    'to process'),
46
 
                    ]
 
48
                   ]
47
49
 
48
50
    boolean_options = ['force']
49
51
 
58
60
        self.set_undefined_options('build', ('force', 'force'))
59
61
        self.prj_name = self.distribution.get_name()
60
62
        if self.build_dir is None:
61
 
            self.build_dir = 'breezy/locale'
 
63
            self.build_dir = 'bzrlib/locale'
62
64
        if not self.output_base:
63
65
            self.output_base = self.prj_name or 'messages'
64
66
        if self.source_dir is None:
92
94
                pot = (self.prj_name or 'messages') + '.pot'
93
95
                en_po = 'en.po'
94
96
                self.spawn(['msginit',
95
 
                            '--no-translator',
96
 
                            '-l', 'en',
97
 
                            '-i', os.path.join(self.source_dir, pot),
98
 
                            '-o', os.path.join(self.source_dir, en_po),
99
 
                            ])
 
97
                    '--no-translator',
 
98
                    '-l', 'en',
 
99
                    '-i', os.path.join(self.source_dir, pot),
 
100
                    '-o', os.path.join(self.source_dir, en_po),
 
101
                    ])
100
102
 
101
103
        basename = self.output_base
102
104
        if not basename.endswith('.mo'):
112
114
            if self.force or newer(po, mo):
113
115
                log.info('Compile: %s -> %s' % (po, mo))
114
116
                self.spawn(['msgfmt', '-o', mo, po])
 
117
 
 
118