Skip to content

Commit 5923960

Browse files
author
Alexander Smishlajev
committed
since we have a reliable msgfmt utility yet...
...compile message objects in the build step (0.8.1 shipped without .mo files)
1 parent c0302e4 commit 5923960

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

setup.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1717
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1818
#
19-
# $Id: setup.py,v 1.77.2.3 2005-02-28 03:13:41 richard Exp $
19+
# $Id: setup.py,v 1.77.2.4 2005-03-01 14:39:00 a1s Exp $
2020

2121
from distutils.core import setup, Extension
2222
from distutils.util import get_platform
@@ -33,6 +33,7 @@
3333
DistributionMetadata.classifiers = None
3434
DistributionMetadata.download_url = None
3535

36+
from roundup import msgfmt
3637

3738
#############################################################################
3839
### Build script files
@@ -191,7 +192,7 @@ def scriptname(path):
191192

192193
### Build Roundup
193194

194-
def list_message_files(suffix=".mo"):
195+
def list_message_files(suffix=".po"):
195196
"""Return list of all found message files and their intallation paths"""
196197
_files = glob("locale/*" + suffix)
197198
_list = []
@@ -242,11 +243,12 @@ def find_modules(self):
242243
class build_roundup(build):
243244

244245
def build_message_files(self):
245-
"""Copy all .mo files to their locale directories"""
246+
"""For each locale/*.po, build .mo file in targen locale directory"""
246247
for (_src, _dst) in list_message_files():
247248
_build_dst = os.path.join("build", _dst)
248249
self.mkpath(os.path.dirname(_build_dst))
249-
self.copy_file(_src, _build_dst)
250+
self.announce("Compiling %s -> %s" % (_src, _build_dst))
251+
msgfmt.make(_src, _build_dst)
250252

251253
def run(self):
252254
check_manifest()
@@ -315,7 +317,7 @@ def main():
315317
'description': "A simple-to-use and -install issue-tracking system"
316318
" with command-line, web and e-mail interfaces. Highly"
317319
" customisable.",
318-
'long_description':
320+
'long_description':
319321
'''Roundup is a simple-to-use and -install issue-tracking system with
320322
command-line, web and e-mail interfaces. It is based on the winning design
321323
from Ka-Ping Yee in the Software Carpentry "Track" design competition.

0 commit comments

Comments
 (0)