Ignore:
Timestamp:
12/01/06 15:15:59 (17 years ago)
Author:
bas
Message:

EmailtoTracScript?:

email2trac.py.in:

  • Use trac.util.text.to_unicode function instead of our own ;-) I run some tests with the new code

email2trac.conf:

  • Fixed a typo in strip_signature statement
Location:
emailtotracscript/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • emailtotracscript/trunk/email2trac.conf

    r136 r138  
    1414drop_spam : 0
    1515verbatim_format: 1
    16 strip_signatures: 1
     16strip_signature: 1
    1717
    1818
  • emailtotracscript/trunk/email2trac.py.in

    r136 r138  
    267267                        str = "%s'''Cc:''' %s [[BR]]" % (str, m['Cc'])
    268268
    269                 return  self.to_unicode(str)
     269                #return  self.to_unicode(str)
     270                return  util.text.to_unicode(str)
     271
    270272
    271273        def set_owner(self, ticket):
     
    298300                        self.email_field = users[0]
    299301                else:
    300                         self.email_field =  self.to_unicode(message['from'])
     302                        #self.email_field =  self.to_unicode(message['from'])
     303                        self.email_field =  util.text.to_unicode(message['from'])
    301304
    302305        def set_reply_fields(self, ticket, message):
     
    332335
    333336                        if mail_list:
    334                                 ticket['cc'] = self.to_unicode(mail_list)
     337                                #ticket['cc'] = self.to_unicode(mail_list)
     338                                ticket['cc'] = util.text.to_unicode(mail_list)
    335339
    336340        def save_email_for_debug(self, message, tempfile=False):
     
    358362                        return False
    359363                else:
    360                         subject  = self.to_unicode(m['Subject'])
     364                        #subject  = self.to_unicode(m['Subject'])
     365                        subject  = util.text.to_unicode(m['Subject'])
    361366
    362367                TICKET_RE = re.compile(r"""
     
    418423                        tkt['summary'] = u'(geen subject)'
    419424                else:
    420                         tkt['summary'] = self.to_unicode(msg['Subject'])
     425                        #tkt['summary'] = self.to_unicode(msg['Subject'])
     426                        tkt['summary'] = util.text.to_unicode(msg['Subject'])
    421427
    422428
     
    464470                        changed = True
    465471                        comment = '\nadded mailto line\n'
    466                         mailto = self.html_mailto_link(self.to_unicode(msg['subject']), ticket_id, body_text)
     472                        #mailto = self.html_mailto_link(self.to_unicode(msg['subject']), ticket_id, body_text)
     473                        mailto = self.html_mailto_link(util.text.to_unicode(msg['subject']), ticket_id, body_text)
    467474                        #tkt['description'] = 'email2trac:%s%s\r\n{{{\r\n%s\r\n}}}' %(head, mailto, body_text)
    468475                        tkt['description'] = 'email2trac:%s%s\r\n%s' %(head, mailto, body_text)
     
    625632                        author = self.email_addr
    626633                else:   
    627                         author = self.to_unicode(self.author)
     634                        #author = self.to_unicode(self.author)
     635                        author = util.text.to_unicode(self.author)
    628636
    629637                # Must find a fix
     
    673681                                filename = '%s%s' % (filename, ext)
    674682                        else:
    675                                 filename = self.to_unicode(filename)
     683                                #filename = self.to_unicode(filename)
     684                                filename = util.text.to_unicode(filename)
    676685
    677686                        # From the trac code
     
    737746                                if not update:
    738747                                        att.author = self.author
    739                                         att.description = self.to_unicode('Added by email2trac')
     748                                        #att.description = self.to_unicode('Added by email2trac')
     749                                        att.description = util.text.to_unicode('Added by email2trac')
    740750
    741751                                att.insert(url_filename, fd, filesize)
Note: See TracChangeset for help on using the changeset viewer.