Changeset 79 for emailtotracscript


Ignore:
Timestamp:
06/02/06 08:53:36 (18 years ago)
Author:
bas
Message:

EmailtoTracScript?:

email2trac.py.in:

  • Language corrections by Nathaniel Irons
File:
1 edited

Legend:

Unmodified
Added
Removed
  • emailtotracscript/trunk/email2trac.py.in

    r78 r79  
    177177                """
    178178                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 TRAC
     179        that is encoded in 7-bit ASCII code and encode it as utf-8 so Trac
    180180                understands it.
    181181                """
     
    305305
    306306        def save_email_for_debug(self, message):
    307 
    308307                msg_file = '/var/tmp/msg.txt'
    309308                print 'TD: saving email to %s' % msg_file
     
    318317        def ticket_update(self, m):
    319318                """
    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.
    322322                """
    323323                if not m['Subject']:
     
    471471        def get_body_text(self, msg):
    472472                """
    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.
    474474                message text can be plain text or html or something else
    475475                """
     
    511511
    512512        def notify(self, tkt , new=True, modtime=0):
     513                """
     514                A wrapper for the TRAC notify function. So we can use templates
     515                """
    513516                try:
    514517                        # create false {abs_}href properties, to trick Notify()
     
    524527
    525528                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)
    528530
    529531        def mail_line(self, str):
     
    556558
    557559        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                '''
    560563                count = 0
    561564                first = 0
     
    663666
    664667        if not os.path.isfile(file):
    665                 print 'File %s does not exists' %file
     668                print 'File %s does not exist' %file
    666669                sys.exit(1)
    667670
     
    678681        if name:
    679682                if not config.has_section(name):
    680                         print "Not an valid project name: %s" %name
     683                        print "Not a valid project name: %s" %name
    681684                        print "Valid names: %s" %config.sections()
    682685                        sys.exit(1)
     
    720723        if not settings.has_key('project'):
    721724                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.'
    723726                sys.exit(1)
    724727
Note: See TracChangeset for help on using the changeset viewer.