Changeset 431


Ignore:
Timestamp:
07/22/10 13:14:17 (14 years ago)
Author:
bas
Message:

Fixed another spellimg ;-) error set.logger. must be self.logger, closes #212

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/email2trac.py.in

    r428 r431  
    8888m = None
    8989
    90 # A UTC class needed for trac version 0.11, added by
    91 # tbaschak at ktc dot mb dot ca
    92 #
    93 class UTC(tzinfo):
    94         """UTC"""
    95         ZERO = timedelta(0)
    96         HOUR = timedelta(hours=1)
    97        
    98         def utcoffset(self, dt):
    99                 return self.ZERO
    100                
    101         def tzname(self, dt):
    102                 return "UTC"
    103                
    104         def dst(self, dt):
    105                 return self.ZERO
    106 
    10790class SaraDict(UserDict.UserDict):
    10891        def __init__(self, dictin = None):
     
    866849                        when = int(time.time())
    867850                else:
    868                         utc = UTC()
    869                         when = datetime.now(utc)
     851                        when = datetime.now(util.datefmt.utc)
    870852
    871853                try:
     
    954936                                if error_with_attachments:
    955937                                        body_text = '%s\\%s' %(error_with_attachments, body_text)
    956                                
     938                                self.logger.debug('tkt.save_changes(%s, %d)' %(self.author, cnum))
    957939                                tkt.save_changes(self.author, body_text, when, None, str(cnum))
    958940                       
     
    11351117                tkt['description'] = body_text
    11361118
    1137                 #when = int(time.time())
    1138                 #
    1139                 utc = UTC()
    1140                 when = datetime.now(utc)
     1119                # When is the change committed
     1120                #
     1121                if self.VERSION < 0.11:
     1122                        when = int(time.time())
     1123                else:
     1124                        when = datetime.now(util.datefmt.utc)
    11411125
    11421126                if self.parameters.dry_run:
     
    12411225                                  % (self.id,))
    12421226                        else:
     1227                                self.logger.debug('Attach %s to ticket %d' %(util.text.unicode_quote(filename), self.id))
    12431228                                att = attachment.Attachment(self.env, 'ticket', self.id)
    12441229 
     
    12511236
    12521237                        try:
     1238                                self.logger.debug('Insert atachment')
    12531239                                att.insert(filename, fd, file_size)
    12541240                        except OSError, detail:
     1241                                self.logger.info('%s\nFilename %s could not be saved, problem: %s' %(status, filename, detail))
    12551242                                status = '%s\nFilename %s could not be saved, problem: %s' %(status, filename, detail)
    12561243
     
    20652052
    20662053                except Exception, e:
    2067                         set.logger.error('Failure sending notification on creation of ticket #%s: %s' %(self.id, e))
     2054                        self.logger.error('Failure sending notification on creation of ticket #%s: %s' %(self.id, e))
    20682055
    20692056
Note: See TracChangeset for help on using the changeset viewer.