Changeset 363 for trunk/email2trac.py.in


Ignore:
Timestamp:
05/20/10 14:45:20 (12 years ago)
Author:
bas
Message:

Automaticaly determine trac version. There is no need for trac_version in /etc/email2trac.conf

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/email2trac.py.in

    r362 r363  
    4242    project      : /data/trac/test   # REQUIRED
    4343    debug        : 1                 # OPTIONAL, if set print some DEBUG info
    44     trac_version : 0.10              # OPTIONAL, default is 0.11
    4544
    4645    [jouvin]                         # OPTIONAL project declaration, if set both fields necessary
     
    7574import traceback
    7675
     76from trac import __version__ as trac_version
    7777
    7878# Will fail where unavailable, e.g. Windows
     
    20412041        settings['dry_run'] = dry_run
    20422042        settings['verbose'] = verbose
     2043
     2044
     2045        # Determine major trac version used to be in email2trac.conf
     2046        #
     2047        version = '0.%s' %(trac_version.split('.')[1])
     2048        if verbose:
     2049                print "Found trac version: %s" %(version)
    20432050       
    2044         if settings.has_key('trac_version'):
    2045                 version = settings['trac_version']
    2046         else:
    2047                 version = trac_default_version
    2048 
    2049 
    20502051        #debug HvB
    20512052        #print settings
Note: See TracChangeset for help on using the changeset viewer.