# HG changeset patch # User cmlenz # Date 1185739457 0 # Node ID 451aac9888f55bc6a18e4d98ab4f5af3006a6813 # Parent 1448b500de4040a5bcedc51098a32ade15eb03fb Use proper logging in distutils `compile_catalog` command. diff --git a/babel/messages/frontend.py b/babel/messages/frontend.py --- a/babel/messages/frontend.py +++ b/babel/messages/frontend.py @@ -145,20 +145,20 @@ for message in list(catalog)[1:]: if message.string: translated +=1 - print "%d of %d messages (%d%%) translated in %r" % ( - translated, len(catalog), translated * 100 // len(catalog), - po_file - ) + log.info('%d of %d messages (%d%%) translated in %r', + translated, len(catalog), + translated * 100 // len(catalog), po_file) if catalog.fuzzy and not self.use_fuzzy: - print 'catalog %r is marked as fuzzy, skipping' % (po_file) + log.warn('catalog %r is marked as fuzzy, skipping', po_file) continue for message, errors in catalog.check(): for error in errors: - print 'error: %s:%d: %s' % (po_file, message.lineno, error) + log.error('error: %s:%d: %s', po_file, message.lineno, + error) - print 'compiling catalog %r to %r' % (po_file, mo_file) + log.info('compiling catalog %r to %r', po_file, mo_file) outfile = open(mo_file, 'w') try: