Ticket #3923: omit-headers-workaround.diff

File omit-headers-workaround.diff, 1.2 KB (added by Evren Esat Özkan <sleytr@…>, 17 years ago)

patch for make-messages.py to workaround ommit-headers bug in xgettext

  • make-messages.py

     
    8585                src = pythonize_re.sub('\n#', src)
    8686                open(os.path.join(dirpath, '%s.py' % file), "wb").write(src)
    8787                thefile = '%s.py' % file
    88                 cmd = 'xgettext %s -d %s -L Perl --keyword=gettext_noop --keyword=gettext_lazy --keyword=ngettext_lazy:1,2 --from-code UTF-8 -o - "%s"' % (
    89                     os.path.exists(potfile) and '--omit-header' or '', domain, os.path.join(dirpath, thefile))
     88                cmd = 'xgettext -d %s -L Perl --keyword=gettext_noop --keyword=gettext_lazy --keyword=ngettext_lazy:1,2 --from-code UTF-8 -o - "%s"' % (
     89                    domain, os.path.join(dirpath, thefile))
    9090                (stdin, stdout, stderr) = os.popen3(cmd, 't')
    91                 msgs = stdout.read()
     91                msgs = os.path.exists(potfile) and ''.join(stdout.readlines()[17:]) or stdout.read()
    9292                errors = stderr.read()
    9393                if errors:
    9494                    print "errors happened while running xgettext on %s" % file
Back to Top