comparison setup.py @ 3220:91067c7d3f0a

since we have a reliable msgfmt utility yet... ...compile message objects in the build step
author Alexander Smishlajev <a1s@users.sourceforge.net>
date Tue, 01 Mar 2005 14:40:36 +0000
parents 29bde1f0d364
children 9c368d4cdac5
comparison
equal deleted inserted replaced
3217:a6bf25d38518 3220:91067c7d3f0a
14 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 14 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
15 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" 15 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
16 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, 16 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
17 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 17 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
18 # 18 #
19 # $Id: setup.py,v 1.80 2005-02-28 03:14:48 richard Exp $ 19 # $Id: setup.py,v 1.81 2005-03-01 14:40:36 a1s Exp $
20 20
21 from distutils.core import setup, Extension 21 from distutils.core import setup, Extension
22 from distutils.util import get_platform 22 from distutils.util import get_platform
23 from distutils.command.build_scripts import build_scripts 23 from distutils.command.build_scripts import build_scripts
24 from distutils.command.build import build 24 from distutils.command.build import build
31 from distutils.dist import DistributionMetadata 31 from distutils.dist import DistributionMetadata
32 if not hasattr(DistributionMetadata, 'classifiers'): 32 if not hasattr(DistributionMetadata, 'classifiers'):
33 DistributionMetadata.classifiers = None 33 DistributionMetadata.classifiers = None
34 DistributionMetadata.download_url = None 34 DistributionMetadata.download_url = None
35 35
36 from roundup import msgfmt
36 37
37 ############################################################################# 38 #############################################################################
38 ### Build script files 39 ### Build script files
39 ############################################################################# 40 #############################################################################
40 41
189 script = string.replace(script, '_', '-') 190 script = string.replace(script, '_', '-')
190 return script 191 return script
191 192
192 ### Build Roundup 193 ### Build Roundup
193 194
194 def list_message_files(suffix=".mo"): 195 def list_message_files(suffix=".po"):
195 """Return list of all found message files and their intallation paths""" 196 """Return list of all found message files and their intallation paths"""
196 _files = glob("locale/*" + suffix) 197 _files = glob("locale/*" + suffix)
197 _list = [] 198 _list = []
198 for _file in _files: 199 for _file in _files:
199 # basename (without extension) is a locale name 200 # basename (without extension) is a locale name
240 241
241 242
242 class build_roundup(build): 243 class build_roundup(build):
243 244
244 def build_message_files(self): 245 def build_message_files(self):
245 """Copy all .mo files to their locale directories""" 246 """For each locale/*.po, build .mo file in target locale directory"""
246 for (_src, _dst) in list_message_files(): 247 for (_src, _dst) in list_message_files():
247 _build_dst = os.path.join("build", _dst) 248 _build_dst = os.path.join("build", _dst)
248 self.mkpath(os.path.dirname(_build_dst)) 249 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)
250 252
251 def run(self): 253 def run(self):
252 check_manifest() 254 check_manifest()
253 self.build_message_files() 255 self.build_message_files()
254 build.run(self) 256 build.run(self)
313 'name': "roundup", 315 'name': "roundup",
314 'version': __version__, 316 'version': __version__,
315 'description': "A simple-to-use and -install issue-tracking system" 317 'description': "A simple-to-use and -install issue-tracking system"
316 " with command-line, web and e-mail interfaces. Highly" 318 " with command-line, web and e-mail interfaces. Highly"
317 " customisable.", 319 " customisable.",
318 'long_description': 320 'long_description':
319 '''Roundup is a simple-to-use and -install issue-tracking system with 321 '''Roundup is a simple-to-use and -install issue-tracking system with
320 command-line, web and e-mail interfaces. It is based on the winning design 322 command-line, web and e-mail interfaces. It is based on the winning design
321 from Ka-Ping Yee in the Software Carpentry "Track" design competition. 323 from Ka-Ping Yee in the Software Carpentry "Track" design competition.
322 324
323 If you're upgrading from an older version of Roundup you *must* follow 325 If you're upgrading from an older version of Roundup you *must* follow

Roundup Issue Tracker: http://roundup-tracker.org/