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

EmailtoTracScript?:

email2trac.py.in:

  • Forgot to unicode the author
  • Preparing for new version
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.