Ticket #1182: make-messages-exclude-existing.diff

File make-messages-exclude-existing.diff, 820 bytes (added by Antti Kaihola, 18 years ago)

re-thought implementation looks for .po files and excludes directories based on that

  • django/bin/make-messages.py

     
    117117                    if thefile != file:
    118118                        os.unlink(os.path.join(dirpath, thefile))
    119119
     120            for dirname in dirnames:
     121                if os.path.isfile(os.path.join(dirpath, dirname, 'locale', lang, 'LC_MESSAGES', domain+'.po')):
     122                    dirnames.remove(dirname)
     123                    print "Excluded directory %s: %s.po for %s exists" % (os.path.join(dirpath, dirname), domain, lang)
     124                   
    120125        if os.path.exists(potfile):
    121126            (stdin, stdout, stderr) = os.popen3('msguniq "%s"' % potfile, 'b')
    122127            msgs = stdout.read()
Back to Top