2008/5/13 Cecil Westerhof <[EMAIL PROTECTED]>:
>  #####
>  startSpaces = re.compile(' +')
>
> def splitLines(thisText):
>     if thisText == None:
>         return None
>     thisText = xml.etree.ElementTree._encode_entity(thisText)
>     lines    = thisText.split('\n')
>     for i in range(len(lines)):
>         match = startSpaces.match(lines[i])
>         if match:
>             lines[i] = '&nbsp;' * match.end() + lines[i][match.end():]
>     return '<br/>'.join(lines)
>  #####

     if thisText == None:
         return None
should be changed to
     if thisText == None:
         return ''

Otherwise XML crashes.

-- 
Cecil Westerhof

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

Reply via email to