Changeset 148


Ignore:
Timestamp:
02/06/07 14:18:12 (17 years ago)
Author:
bas
Message:

EmailToTracScript?
EmailtoTracScript?:

email2trac.py.in, email2trac.conf:

  • Added textwrap option, use_textwrap: 70 lines vannot be longer then 70 chars
Location:
emailtotracscript/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • emailtotracscript/trunk/email2trac.conf

    r138 r148  
    1515verbatim_format: 1
    1616strip_signature: 1
     17use_textwrap: 70
    1718
    1819
  • emailtotracscript/trunk/email2trac.py.in

    r146 r148  
    5858        mailto_cc    : basv@sara.nl    # OPTIONAL, use this address as CC in mailto line
    5959        ticket_update: 1               # OPTIONAL, if set then check if this is an update for a ticket
    60         trac_version : 0.8             # OPTIONAL, default is 0.9
    61 
    62         [jouvin]                         # OPTIONAL project declaration, if set both fields necessary
     60        trac_version : 0.8             # OPTIONAL, default is 0.10
     61
     62        [jouvin]                       # OPTIONAL project declaration, if set both fields necessary
    6363        project      : /data/trac/jouvin # use -p|--project jouvin. 
    6464       
     
    182182                        self.STRIP_SIGNATURE = 0
    183183
     184                if parameters.has_key('use_textwrap'):
     185                        self.USE_TEXTWRAP = int(parameters['use_textwrap'])
     186                else:
     187                        self.USE_TEXTWRAP = 0
     188
    184189        # X-Spam-Score: *** (3.255) BAYES_50,DNS_FROM_AHBL_RHSBL,HTML_
    185190        # Note if Spam_level then '*' are included
     
    556561                                if self.STRIP_SIGNATURE:
    557562                                        body_text = self.strip_signature(body_text)
     563
     564
     565                                if self.USE_TEXTWRAP:
     566                                        import textwrap
     567                                        body_text = textwrap.fill( body_text,
     568                                                                                           width = self.USE_TEXTWRAP,
     569                                                                                           replace_whitespace = False )
    558570
    559571                                # Get contents charset (iso-8859-15 if not defined in mail headers)
Note: See TracChangeset for help on using the changeset viewer.