Changeset 142


Ignore:
Timestamp:
12/05/06 16:19:57 (16 years ago)
Author:
bas
Message:

EmailtoTracScript?:

email2trac.py.in:

  • Forgot to unicode the author
  • Preparing for new version
Location:
emailtotracscript/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • emailtotracscript/trunk/ChangeLog

    r141 r142  
    1 2XXXXXX
     12006-12-
    22        * email2trac.py:
    33          - Added verbatim_format option default is: 1
     
    1313          Fixed by: Bas van der Vlies
    1414
    15            - Fixed statements: str + unicode, raises an exception if
    16              non-ascii value in unicode object.
     15          - Fixed statements: str + unicode, raises an exception if
     16            non-ascii value in unicode object.
     17
     18          - Forgot to unicode the author. So we got an error if we use
     19            the mailto_link option in email2trac.conf.
    1720          Fixed by: Bas van der Vlies
    1821
  • emailtotracscript/trunk/debian/changelog

    r139 r142  
     1email2trac (0.9.0-1) stable; urgency=low
     2
     3  * New version nothing changed
     4
     5 -- root <root@subtrac.sara.nl>  Mon,  4 Dec 2006 18:57:16 +0100
     6
    17email2trac (0.8.2-2) stable; urgency=low
    28
  • emailtotracscript/trunk/email2trac.py.in

    r141 r142  
    292292                self.author, self.email_addr  = email.Utils.parseaddr(message['from'])
    293293
     294                self.author = self.email_to_unicode(self.author)
     295                #self.author = self.author.encode('utf-8', 'replace')
     296
    294297                # Look for email address in registered trac users
    295298                #
     
    448451                        head = self.email_header_txt(msg)
    449452                       
    450 
    451453                body_text = self.get_body_text(msg)
    452454
    453455                tkt['description'] = '\r\n%s\r\n%s' \
    454                         %(head, body_text.decode('utf-8'))
     456                        %(head, body_text)
    455457
    456458                when = int(time.time())
     
    468470                if self.MAILTO:
    469471                        changed = True
    470                         comment = '\nadded mailto line\n'
    471                         mailto = self.html_mailto_link(self.email_to_unicode(msg['subject']), ticket_id, body_text)
    472                         tkt['description'] = '\r\n%s%s\r\n%s\r\n' \
    473                                 %(head, mailto, body_text.decode('utf-8'))
     472                        comment = u'\nadded mailto line\n'
     473                        mailto = self.html_mailto_link(tkt['summary'], ticket_id, body_text)
     474                        tkt['description'] = u'\r\n%s\r\n%s%s\r\n' \
     475                                %(head, mailto, body_text)
    474476
    475477                n =  self.attachments(msg, tkt)
     
    589591                #  else we a lot of garbage
    590592                #
    591                 if encoding:
    592                         ubody_text = ubody_text.encode('utf-8')
     593                #if encoding:
     594                #       ubody_text = ubody_text.encode('utf-8')
    593595
    594596                if self.VERBATIM_FORMAT:
     
    627629        def html_mailto_link(self, subject, id, body):
    628630                if not self.author:
    629                         author = self.email_addr
     631                        author = self.self.email_addr
    630632                else:   
    631                         author = self.email_to_unicode(self.author)
     633                        author = self.author
    632634
    633635                # Must find a fix
     
    639641
    640642                # Temporary fix
     643                #
    641644                str = 'mailto:%s?Subject=%s&Cc=%s' %(
    642645                       urllib.quote(self.email_addr),
     
    646649
    647650                str = '\r\n{{{\r\n#!html\r\n<a href="%s">Reply to: %s</a>\r\n}}}\r\n' %(str, author)
    648 
    649651                return str
    650652
  • emailtotracscript/trunk/email2trac.spec

    r132 r142  
    11Summary: Utilities for converting emails to trac tickets
    22Name: email2trac
    3 Version: 0.8.2
     3Version: 0.9.0
    44Release: 1
    55License: GPL
Note: See TracChangeset for help on using the changeset viewer.