Changeset 360 for trunk/email2trac.py.in


Ignore:
Timestamp:
05/20/10 08:52:13 (11 years ago)
Author:
bas
Message:

Added an extra option ticket_update_by_subject_lookback in combo with
ticket_update_by_subject. Default value is 30 days, see #188

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/email2trac.py.in

    r359 r360  
    203203                        self.TICKET_UPDATE_BY_SUBJECT = 0
    204204
     205                if parameters.has_key('ticket_update_by_subject_lookback'):
     206                        self.TICKET_UPDATE_BY_SUBJECT_LOOKBACK = int(parameters['ticket_update_by_subject_lookback'])
     207                else:
     208                        self.TICKET_UPDATE_BY_SUBJECT_LOOKBACK = 30
     209
    205210                if parameters.has_key('drop_spam'):
    206211                        self.DROP_SPAM = int(parameters['drop_spam'])
     
    919924                                summaries = [orig_subject, '%%: %s' % orig_subject]
    920925
    921                                 # hard-code the time to 30 days for now. Can easily be
    922                                 # made configurable
    923                                 lookback = int(time.mktime(time.gmtime())) - 2592000
     926                                ##
     927                                # Convert days to seconds
     928                                lookback = int(time.mktime(time.gmtime())) - \
     929                                                self.TICKET_UPDATE_BY_SUBJECT_LOOKBACK * 24 * 3600
     930
    924931
    925932                                for summary in summaries:
Note: See TracChangeset for help on using the changeset viewer.