olivier wrote:
> Hi Carl,
> 
> Actually, it seems like the header stripping on line 122 of make-
> message.py is too aggressive and removes all lines of the output of
> xgettext.
> 
> I replaced :
> 
>                         msgs = '\n'.join(dropwhile(len,
> msgs.split('\n')))
> 
> by:
> 
>                         lines = msgs.split("\n")
>                         msg, write = [], False
>                         for line in lines:
>                             if not line.strip():
>                                 write = True
>                             if write:
>                                 msg.append(line)
>                         msgs = "\n".join(msg)
> 
> 
> (space formatting will probably get messed up by google group)
> 
> and everything goes fine.
> I'll fill a ticket when I can.
> 
> Olivier
> 
> 

How is it any different?    I tried various values of X in the code below, and 
they all came up
Equal: True

Guessing it is either a windows/unix newline thing, or unicode.

Carl K


from itertools import dropwhile

def f1(msgs):
     msgs = '\n'.join(dropwhile(len, msgs.split('\n')))
     return msgs

def f2(msgs):
     lines = msgs.split("\n")
     msg, write = [], False
     for line in lines:
         if not line.strip():
             write = True
         if write:
             msg.append(line)
     msgs = "\n".join(msg)
     return msgs

def dump(m):
      print len(m), [ hex(ord(x)) for x in m ]

# test parameter
x='\n \na\nbc\n\n\nd\n\ne\n'
dump(x)

y1=f1(x)
y2=f2(x)

# examine results
dump(y1)
dump(y2)

print "Equal: %s" % (y1==y2)







--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to