Changeset 79
- Timestamp:
- 06/02/06 08:53:36 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
emailtotracscript/trunk/email2trac.py.in
r78 r79 177 177 """ 178 178 Email has 7 bit ASCII code, convert it to unicode with the charset 179 that is encoded in 7-bit ASCII code and encode it as utf-8 so TRAC179 that is encoded in 7-bit ASCII code and encode it as utf-8 so Trac 180 180 understands it. 181 181 """ … … 305 305 306 306 def save_email_for_debug(self, message): 307 308 307 msg_file = '/var/tmp/msg.txt' 309 308 print 'TD: saving email to %s' % msg_file … … 318 317 def ticket_update(self, m): 319 318 """ 320 This function checks if this is an update of an existing ticket. 321 If yes it will update the ticket information 319 If the current email is a reply to an existing ticket, this function 320 will append the contents of this email to that ticket, instead of 321 creating a new one. 322 322 """ 323 323 if not m['Subject']: … … 471 471 def get_body_text(self, msg): 472 472 """ 473 put the message text in the ticket description or in the changes field 473 put the message text in the ticket description or in the changes field. 474 474 message text can be plain text or html or something else 475 475 """ … … 511 511 512 512 def notify(self, tkt , new=True, modtime=0): 513 """ 514 A wrapper for the TRAC notify function. So we can use templates 515 """ 513 516 try: 514 517 # create false {abs_}href properties, to trick Notify() … … 524 527 525 528 except Exception, e: 526 print 'TD: Failure sending notification on creation of ticket #%s: %s' \ 527 % (tkt['id'], e) 529 print 'TD: Failure sending notification on creation of ticket #%s: %s' %(tkt['id'], e) 528 530 529 531 def mail_line(self, str): … … 556 558 557 559 def attachments(self, message, ticket): 558 '''save any attachments as file in the ticket's directory''' 559 560 ''' 561 save any attachments as files in the ticket's directory 562 ''' 560 563 count = 0 561 564 first = 0 … … 663 666 664 667 if not os.path.isfile(file): 665 print 'File %s does not exist s' %file668 print 'File %s does not exist' %file 666 669 sys.exit(1) 667 670 … … 678 681 if name: 679 682 if not config.has_section(name): 680 print "Not a nvalid project name: %s" %name683 print "Not a valid project name: %s" %name 681 684 print "Valid names: %s" %config.sections() 682 685 sys.exit(1) … … 720 723 if not settings.has_key('project'): 721 724 print __doc__ 722 print 'No project defined in config file, eg:\n\t project: /data/trac/bas'725 print 'No Trac project is defined in the email2trac config file.' 723 726 sys.exit(1) 724 727
Note: See TracChangeset
for help on using the changeset viewer.