Changeset 2091

Show
Ignore:
Timestamp:
03/09/07 04:45:05 (2 years ago)
Author:
bas
Message:

EmailToTracScript
EmailtoTracScript:

email2trac.py.in:

  • Added use_textwrap function from Rainer Sokoll
  • Fixed a dutch spelling error
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • emailtotracscript/trunk/ChangeLog

    r2090 r2091  
    22 
    33        * Added some primarily check to catch an error when attachment size 
    4          is too large, bug #1153 
    5          Author: Bas van der Vlies 
     4          is too large, bug #1153 
     5          Author: Bas van der Vlies 
     6 
     7        * Wrap long line into user given length, use_textwrap: 72. Wraps lines 
     8          greater then 72 chars, #1123 
     9          Author: Bas van der Vlies &  
     10                  Rainer Sokoll (r.sokoll at intershop dot de) 
     11 
     12        * Fixed a dutch spelling, #1295 
     13          Author: Rainer Sokoll (r.sokoll at intershop dot de) 
     14 
    615 
    7162007-03-08 Michel Jouvin <jouvin@lal.in2p3.fr> 
  • emailtotracscript/trunk/email2trac.py.in

    r2090 r2091  
    440440 
    441441                if not msg['Subject']: 
    442                         tkt['summary'] = u'(geen subject)' 
     442                        tkt['summary'] = u'(No subject)' 
    443443                else: 
    444444                        tkt['summary'] = self.email_to_unicode(msg['Subject']) 
     
    551551 
    552552                return ('\n'.join(body)) 
     553 
     554 
     555        def wrap_text(str='', width = self.USE_TEXTWRAP, replace_whitespace = False): 
     556                """ 
     557                Will break a lines longer then given length into several small lines of size  
     558                given length 
     559                """ 
     560                import textwrap 
     561                LINESEPARATOR = '\n' 
     562                return LINESEPARATOR.join(textwrap.fill(s,width) for s in str.split(LINESEPARATOR)) 
    553563 
    554564        def get_body_text(self, msg): 
     
    577587                                        body_text = self.strip_signature(body_text) 
    578588 
    579  
    580589                                if self.USE_TEXTWRAP: 
    581                                         import textwrap 
    582                                         body_text = textwrap.fill( body_text,  
    583                                                                                            width = self.USE_TEXTWRAP,  
    584                                                                                            replace_whitespace = False ) 
     590                                        body_text = self.wrap_text(body_text) 
    585591 
    586592                                # Get contents charset (iso-8859-15 if not defined in mail headers)