Ticket #36: trac-config.diff

File trac-config.diff, 1.1 KB (added by andrei2102@…, 16 years ago)

patch after changeset [193]

  • ./

    old new  
    100100    SYSLOG_AVAILABLE = False
    101101
    102102from datetime import tzinfo, timedelta, datetime
    103 
     103from trac import config as trac_config
    104104
    105105# Some global variables
    106106#
     
    997997                print 'File %s does not exist' %file
    998998                sys.exit(1)
    999999
    1000         config = ConfigParser.ConfigParser()
    1001         try:
    1002                 config.read(file)
    1003         except ConfigParser.MissingSectionHeaderError,detail:
    1004                 print detail
    1005                 sys.exit(1)
    1006 
     1000        config = trac_config.Configuration(file)
    10071001
    10081002        # Use given project name else use defaults
    10091003        #
    10101004        if name:
    1011                 if not config.has_section(name):
     1005                sections = config.sections()
     1006                if not name in sections:
    10121007                        print "Not a valid project name: %s" %name
    1013                         print "Valid names: %s" %config.sections()
     1008                        print "Valid names: %s" %sections
    10141009                        sys.exit(1)
    10151010
    10161011                project =  dict()
    1017                 for option in  config.options(name):
    1018                         project[option] = config.get(name, option)
     1012                for option, value in  config.options(name):
     1013                        project[option] = value
    10191014
    10201015        else:
    10211016                project = config.defaults()