- Timestamp:
- 03/24/10 15:53:38 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/email2trac.py.in
r342 r343 953 953 changed = True 954 954 comment = u'\nadded mailto line\n' 955 mailto = self.html_mailto_link( m['Subject'] , body_text)955 mailto = self.html_mailto_link( m['Subject']) 956 956 957 957 tkt['description'] = u'%s\r\n%s%s\r\n' \ … … 1209 1209 self.new_ticket(m, subject, spam_msg) 1210 1210 1211 ########## BODY TEXT functions ########################################################### 1212 1211 1213 def strip_signature(self, text): 1212 1214 """ … … 1319 1321 # 1320 1322 1323 ########## EMAIL attachements functions ########################################################### 1324 1321 1325 def inline_part(self, part): 1322 1326 """ … … 1532 1536 except attachment.ResourceNotFound: 1533 1537 return False 1538 1539 ########## TRAC Ticket Text ########################################################### 1534 1540 1535 1541 def body_text(self, message_parts): … … 1556 1562 return body_text 1557 1563 1564 def html_mailto_link(self, subject): 1565 """ 1566 This function returns a HTML mailto tag with the ticket id and author email address 1567 """ 1568 if not self.author: 1569 author = self.email_addr 1570 else: 1571 author = self.author 1572 1573 # use urllib to escape the chars 1574 # 1575 s = 'mailto:%s?Subject=%s&Cc=%s' %( 1576 urllib.quote(self.email_addr), 1577 urllib.quote('Re: #%s: %s' %(self.id, subject)), 1578 urllib.quote(self.MAILTO_CC) 1579 ) 1580 1581 s = '\r\n{{{\r\n#!html\r\n<a\r\n href="%s">Reply to: %s\r\n</a>\r\n}}}\r\n' %(s, author) 1582 return s 1583 1584 ########## TRAC notify section ########################################################### 1585 1558 1586 def notify(self, tkt, new=True, modtime=0): 1559 1587 """ … … 1594 1622 print 'TD: Failure sending notification on creation of ticket #%s: %s' %(self.id, e) 1595 1623 1596 def html_mailto_link(self, subject, body): 1597 """ 1598 This function returns a HTML mailto tag with the ticket id and author email address 1599 """ 1600 if not self.author: 1601 author = self.email_addr 1602 else: 1603 author = self.author 1604 1605 # use urllib to escape the chars 1606 # 1607 s = 'mailto:%s?Subject=%s&Cc=%s' %( 1608 urllib.quote(self.email_addr), 1609 urllib.quote('Re: #%s: %s' %(self.id, subject)), 1610 urllib.quote(self.MAILTO_CC) 1611 ) 1612 1613 s = '\r\n{{{\r\n#!html\r\n<a\r\n href="%s">Reply to: %s\r\n</a>\r\n}}}\r\n' %(s, author) 1614 return s 1615 1624 1625 1626 ########## Parse Config File ########################################################### 1616 1627 1617 1628 def ReadConfig(file, name):
Note: See TracChangeset
for help on using the changeset viewer.