Mercurial > babel > mirror
comparison babel/messages/frontend.py @ 605:6dc7e067bafc trunk
fix 'input_dirs' option for setuptools integration (#232, initial patch by ?tienne Bersac)
author | fschwarz |
---|---|
date | Thu, 23 Aug 2012 09:48:21 +0000 |
parents | bf5d10a56bbe |
children | c5dd3752bf2a |
comparison
equal
deleted
inserted
replaced
604:bf5d10a56bbe | 605:6dc7e067bafc |
---|---|
21 from distutils.errors import DistutilsOptionError, DistutilsSetupError | 21 from distutils.errors import DistutilsOptionError, DistutilsSetupError |
22 from locale import getpreferredencoding | 22 from locale import getpreferredencoding |
23 import logging | 23 import logging |
24 from optparse import OptionParser | 24 from optparse import OptionParser |
25 import os | 25 import os |
26 import re | |
26 import shutil | 27 import shutil |
27 from StringIO import StringIO | 28 from StringIO import StringIO |
28 import sys | 29 import sys |
29 import tempfile | 30 import tempfile |
30 | 31 |
222 'place comment block with TAG (or those preceding keyword lines) in ' | 223 'place comment block with TAG (or those preceding keyword lines) in ' |
223 'output file. Separate multiple TAGs with commas(,)'), | 224 'output file. Separate multiple TAGs with commas(,)'), |
224 ('strip-comments', None, | 225 ('strip-comments', None, |
225 'strip the comment TAGs from the comments.'), | 226 'strip the comment TAGs from the comments.'), |
226 ('input-dirs=', None, | 227 ('input-dirs=', None, |
227 'directories that should be scanned for messages'), | 228 'directories that should be scanned for messages. Separate multiple ' |
229 'directories with commas(,)'), | |
228 ] | 230 ] |
229 boolean_options = [ | 231 boolean_options = [ |
230 'no-default-keywords', 'no-location', 'omit-header', 'no-wrap', | 232 'no-default-keywords', 'no-location', 'omit-header', 'no-wrap', |
231 'sort-output', 'sort-by-file', 'strip-comments' | 233 'sort-output', 'sort-by-file', 'strip-comments' |
232 ] | 234 ] |
272 | 274 |
273 if self.sort_output and self.sort_by_file: | 275 if self.sort_output and self.sort_by_file: |
274 raise DistutilsOptionError("'--sort-output' and '--sort-by-file' " | 276 raise DistutilsOptionError("'--sort-output' and '--sort-by-file' " |
275 "are mutually exclusive") | 277 "are mutually exclusive") |
276 | 278 |
277 if not self.input_dirs: | 279 if self.input_dirs: |
280 self.input_dirs = re.split(',\s*', self.input_dirs) | |
281 else: | |
278 self.input_dirs = dict.fromkeys([k.split('.',1)[0] | 282 self.input_dirs = dict.fromkeys([k.split('.',1)[0] |
279 for k in self.distribution.packages | 283 for k in self.distribution.packages |
280 ]).keys() | 284 ]).keys() |
281 | 285 |
282 if self.add_comments: | 286 if self.add_comments: |