Changeset 365


Ignore:
Timestamp:
05/20/10 15:43:47 (11 years ago)
Author:
bas
Message:

delete_spam still used trac_version in /etc/email2trac.conf. Fixed

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/debian/changelog

    r363 r365  
     1email2trac (1.4.1-1) stable; urgency=low
     2
     3  * delete_spam still used trac_version in /etc/email2trac.conf
     4
     5 -- Bas van der Vlies <basv@sara.nl>  Thu, 20 May 2010 15:40:20 +0200
     6
    17email2trac (1.4.0-3) stable; urgency=low
    28
  • trunk/delete_spam.py.in

    r351 r365  
    4343import ConfigParser
    4444
    45 trac_default_version = 0.10
     45from trac import __version__ as trac_version
    4646
    4747def ReadConfig(file, name):
     
    147147                elif opt in ['-v', '--verbose']:
    148148                        VERBOSE = True
     149
     150        ## trac version is defined like this  X.version.X
     151        #
     152        version = int(trac_version.split('.')[1])
     153        if VERBOSE:
     154                print "Found trac version: %d" %version
     155
     156        if version < 10:
     157                print 'Trac version %s is not suported' %(version)
    149158       
    150159        settings = ReadConfig(configfile, project_name)
     
    153162                print 'No project defined in config file, eg:\n\t project: /data/trac/bas'
    154163                sys.exit(1)
    155 
    156         if settings.has_key('trac_version'):
    157                 version = float(settings['trac_version'])
    158         else:
    159                 version = trac_default_version
    160164
    161165        settings['DRY_RUN'] = DRY_RUN
     
    167171
    168172
    169         if version < 0.10:
    170                 print 'Trac version %s is not suported' %(version)
    171173
    172174        new_delete_spam(settings)
Note: See TracChangeset for help on using the changeset viewer.