Changeset 142 for emailtotracscript/trunk/email2trac.py.in
- Timestamp:
- 12/05/06 16:19:57 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
emailtotracscript/trunk/email2trac.py.in
r141 r142 292 292 self.author, self.email_addr = email.Utils.parseaddr(message['from']) 293 293 294 self.author = self.email_to_unicode(self.author) 295 #self.author = self.author.encode('utf-8', 'replace') 296 294 297 # Look for email address in registered trac users 295 298 # … … 448 451 head = self.email_header_txt(msg) 449 452 450 451 453 body_text = self.get_body_text(msg) 452 454 453 455 tkt['description'] = '\r\n%s\r\n%s' \ 454 %(head, body_text .decode('utf-8'))456 %(head, body_text) 455 457 456 458 when = int(time.time()) … … 468 470 if self.MAILTO: 469 471 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) 474 476 475 477 n = self.attachments(msg, tkt) … … 589 591 # else we a lot of garbage 590 592 # 591 if encoding:592 ubody_text = ubody_text.encode('utf-8')593 #if encoding: 594 # ubody_text = ubody_text.encode('utf-8') 593 595 594 596 if self.VERBATIM_FORMAT: … … 627 629 def html_mailto_link(self, subject, id, body): 628 630 if not self.author: 629 author = self. email_addr631 author = self.self.email_addr 630 632 else: 631 author = self. email_to_unicode(self.author)633 author = self.author 632 634 633 635 # Must find a fix … … 639 641 640 642 # Temporary fix 643 # 641 644 str = 'mailto:%s?Subject=%s&Cc=%s' %( 642 645 urllib.quote(self.email_addr), … … 646 649 647 650 str = '\r\n{{{\r\n#!html\r\n<a href="%s">Reply to: %s</a>\r\n}}}\r\n' %(str, author) 648 649 651 return str 650 652
Note: See TracChangeset
for help on using the changeset viewer.