Changeset 409
- Timestamp:
- 07/20/10 07:53:52 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/email2trac.py.in
r408 r409 139 139 """ 140 140 override the class attribute get method. Return the value 141 from the Userdict141 from the dictionary 142 142 """ 143 143 if self.data.has_key(name): … … 462 462 to send mail to the ticket list 463 463 """ 464 self.logger.debug('function email_header_acl: %s' %keyword) 465 464 466 try: 465 467 mail_addresses = self.parameters[keyword] … … 543 545 Set all the right fields for a new ticket 544 546 """ 545 self.logger. info('function set_reply_fields')547 self.logger.debug('function set_reply_fields') 546 548 547 549 ## Only use name or email adress … … 629 631 """ 630 632 """ 631 self.logger. info('function debug_attachments')633 self.logger.debug('function debug_attachments') 632 634 633 635 n = 0 … … 712 714 understands it. 713 715 """ 714 self.logger. info("function email_to_unicode")716 self.logger.debug("function email_to_unicode") 715 717 716 718 results = email.Header.decode_header(message_str) … … 746 748 Transfrom a string of the form [<key>=<value>]+ to dict[<key>] = <value> 747 749 """ 748 self.logger. info("function str_to_dict")750 self.logger.debug("function str_to_dict") 749 751 750 752 fields = string.split(s, self.SUBJECT_FIELD_SEPARATOR) … … 783 785 Check if the mailer is allowed to update the ticket 784 786 """ 785 self.logger. info('function check_permission_participants')787 self.logger.debug('function check_permission_participants') 786 788 787 789 if tkt['reporter'].lower() in [self.author, self.email_addr]: 788 790 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)) 790 792 791 793 return True … … 827 829 - email2trac: .... 828 830 """ 829 self.logger. info("function check_permission")831 self.logger.debug("function check_permission") 830 832 831 833 if self.TICKET_PERMISSION_SYSTEM in ['trac']: … … 859 861 2) Set default value for field (use_default=1) 860 862 """ 861 self.logger. info("function update_ticket_fields")863 self.logger.debug("function update_ticket_fields") 862 864 863 865 # Build a system dictionary from the ticket fields … … 928 930 creating a new one. 929 931 """ 930 self.logger. info("function ticket_update")932 self.logger.debug("function ticket_update") 931 933 932 934 # Must we update ticket fields … … 948 950 self.id = int(id[1:]) 949 951 950 self.logger. info("function ticket_update id %s" %id)952 self.logger.debug("function ticket_update id %s" %id) 951 953 952 954 # When is the change committed … … 972 974 if self.TICKET_PERMISSION_SYSTEM: 973 975 if not self.check_permission(tkt, 'TICKET_MODIFY'): 974 print 'Reporter: %s has no permission to modify tickets' %self.author976 self.logger.info('Reporter: %s has no permission to modify tickets' %self.author) 975 977 return False 976 978 … … 1118 1120 So we must have the last column 1119 1121 """ 1120 self.logger. info('function ticket_update_by_subject')1122 self.logger.debug('function ticket_update_by_subject') 1121 1123 1122 1124 matched_id = None … … 1170 1172 Create a new ticket 1171 1173 """ 1172 self.logger. info('function new_ticket')1174 self.logger.debug('function new_ticket') 1173 1175 1174 1176 tkt = Ticket(self.env) … … 1182 1184 if self.TICKET_PERMISSION_SYSTEM: 1183 1185 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) 1185 1187 return False 1186 1188 … … 1281 1283 save any attachments as files in the ticket's directory 1282 1284 ''' 1283 self.logger. info('function attach_attachments()')1285 self.logger.debug('function attach_attachments()') 1284 1286 1285 1287 if self.parameters.dry_run: … … 1598 1600 """ 1599 1601 """ 1600 self.logger. info('Main function parse')1602 self.logger.debug('Main function parse') 1601 1603 global m 1602 1604 … … 1816 1818 Parse text if we use inline keywords to set ticket fields 1817 1819 """ 1818 if self.parameters.debug: 1819 self.logger.info('function inline_properties') 1820 self.logger.debug('function inline_properties') 1820 1821 1821 1822 properties = dict() … … 1867 1868 """ 1868 1869 """ 1869 self.logger. info('function inline_part()')1870 self.logger.debug('function inline_part()') 1870 1871 1871 1872 return part.get_param('inline', None, 'Content-Disposition') == '' or not part.has_key('Content-Disposition') … … 1876 1877 body parts are returned as strings, attachments are returned as tuples of (filename, Message object) 1877 1878 """ 1878 self.logger. info('function get_message_parts()')1879 self.logger.debug('function get_message_parts()') 1879 1880 1880 1881 message_parts = list() … … 2132 2133 A wrapper for the TRAC notify function. So we can use templates 2133 2134 """ 2134 self.logger. info('function notify()')2135 self.logger.debug('function notify()') 2135 2136 2136 2137 if self.parameters.dry_run:
Note: See TracChangeset
for help on using the changeset viewer.