Ticket #4899: ticket-4899.diff

File ticket-4899.diff, 718 bytes (added by Ramiro Morales, 17 years ago)
  • django/bin/make-messages.py

    old new  
    99import os
    1010import sys
    1111import getopt
     12from itertools import dropwhile
    1213
    1314pythonize_re = re.compile(r'\n\s*//')
    1415
     
    118119                        msgs = msgs.replace(old, new)
    119120                    if os.path.exists(potfile):
    120121                        # Strip the header
    121                         msgs = '\n'.join(msgs.split('\n')[17:])
     122                        msgs = '\n'.join(dropwhile(len, msgs.split('\n')))
    122123                    else:
    123124                        msgs = msgs.replace('charset=CHARSET', 'charset=UTF-8')
    124125                    if msgs:
Back to Top