Changeset 409


Ignore:
Timestamp:
07/20/10 07:53:52 (14 years ago)
Author:
bas
Message:

email2trac.py.in:

  • function are now debug level logging and permission issue are now info messages
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/email2trac.py.in

    r408 r409  
    139139                """
    140140                override the class attribute get method. Return the value
    141                 from the Userdict
     141                from the dictionary
    142142                """
    143143                if self.data.has_key(name):
     
    462462                to send mail to the ticket list
    463463            """
     464                self.logger.debug('function email_header_acl: %s' %keyword)
     465
    464466                try:
    465467                        mail_addresses = self.parameters[keyword]
     
    543545                Set all the right fields for a new ticket
    544546                """
    545                 self.logger.info('function set_reply_fields')
     547                self.logger.debug('function set_reply_fields')
    546548
    547549                ## Only use name or email adress
     
    629631                """
    630632                """
    631                 self.logger.info('function debug_attachments')
     633                self.logger.debug('function debug_attachments')
    632634               
    633635                n = 0
     
    712714                understands it.
    713715                """
    714                 self.logger.info("function email_to_unicode")
     716                self.logger.debug("function email_to_unicode")
    715717
    716718                results =  email.Header.decode_header(message_str)
     
    746748                Transfrom a string of the form [<key>=<value>]+ to dict[<key>] = <value>
    747749                """
    748                 self.logger.info("function str_to_dict")
     750                self.logger.debug("function str_to_dict")
    749751
    750752                fields = string.split(s, self.SUBJECT_FIELD_SEPARATOR)
     
    783785                Check if the mailer is allowed to update the ticket
    784786                """
    785                 self.logger.info('function check_permission_participants')
     787                self.logger.debug('function check_permission_participants')
    786788
    787789                if tkt['reporter'].lower() in [self.author, self.email_addr]:
    788790                        if self.parameters.debug:
    789                                 self.logger.debug('ALLOW, %s is the ticket reporter' %(self.email_addr))
     791                                self.logger.info('ALLOW, %s is the ticket reporter' %(self.email_addr))
    790792
    791793                        return True
     
    827829                        - email2trac: ....
    828830                """
    829                 self.logger.info("function check_permission")
     831                self.logger.debug("function check_permission")
    830832
    831833                if self.TICKET_PERMISSION_SYSTEM in ['trac']:
     
    859861                           2) Set default value for field (use_default=1)
    860862                """
    861                 self.logger.info("function update_ticket_fields")
     863                self.logger.debug("function update_ticket_fields")
    862864
    863865                # Build a system dictionary from the ticket fields
     
    928930                creating a new one.
    929931                """
    930                 self.logger.info("function ticket_update")
     932                self.logger.debug("function ticket_update")
    931933
    932934                # Must we update ticket fields
     
    948950                        self.id = int(id[1:])
    949951
    950                 self.logger.info("function ticket_update id %s" %id)
     952                self.logger.debug("function ticket_update id %s" %id)
    951953
    952954                # When is the change committed
     
    972974                if self.TICKET_PERMISSION_SYSTEM:
    973975                        if not self.check_permission(tkt, 'TICKET_MODIFY'):
    974                                 print 'Reporter: %s has no permission to modify tickets' %self.author
     976                                self.logger.info('Reporter: %s has no permission to modify tickets' %self.author)
    975977                                return False
    976978
     
    11181120                So we must have the last column
    11191121                """
    1120                 self.logger.info('function ticket_update_by_subject')
     1122                self.logger.debug('function ticket_update_by_subject')
    11211123
    11221124                matched_id = None
     
    11701172                Create a new ticket
    11711173                """
    1172                 self.logger.info('function new_ticket')
     1174                self.logger.debug('function new_ticket')
    11731175
    11741176                tkt = Ticket(self.env)
     
    11821184                if self.TICKET_PERMISSION_SYSTEM:
    11831185                        if not self.check_permission(tkt, 'TICKET_CREATE'):
    1184                                 self.logger.error('Reporter: %s has no permission to create tickets' %self.author)
     1186                                self.logger.info('Reporter: %s has no permission to create tickets' %self.author)
    11851187                                return False
    11861188
     
    12811283                save any attachments as files in the ticket's directory
    12821284                '''
    1283                 self.logger.info('function attach_attachments()')
     1285                self.logger.debug('function attach_attachments()')
    12841286
    12851287                if self.parameters.dry_run:
     
    15981600                """
    15991601                """
    1600                 self.logger.info('Main function parse')
     1602                self.logger.debug('Main function parse')
    16011603                global m
    16021604
     
    18161818                Parse text if we use inline keywords to set ticket fields
    18171819                """
    1818                 if self.parameters.debug:
    1819                         self.logger.info('function inline_properties')
     1820                self.logger.debug('function inline_properties')
    18201821
    18211822                properties = dict()
     
    18671868                """
    18681869                """
    1869                 self.logger.info('function inline_part()')
     1870                self.logger.debug('function inline_part()')
    18701871
    18711872                return part.get_param('inline', None, 'Content-Disposition') == '' or not part.has_key('Content-Disposition')
     
    18761877                body parts are returned as strings, attachments are returned as tuples of (filename, Message object)
    18771878                """
    1878                 self.logger.info('function get_message_parts()')
     1879                self.logger.debug('function get_message_parts()')
    18791880
    18801881                message_parts = list()
     
    21322133                A wrapper for the TRAC notify function. So we can use templates
    21332134                """
    2134                 self.logger.info('function notify()')
     2135                self.logger.debug('function notify()')
    21352136
    21362137                if self.parameters.dry_run:
Note: See TracChangeset for help on using the changeset viewer.