Ticket #36: trac-config.diff
File trac-config.diff, 1.1 KB (added by andrei2102@…, 16 years ago) |
---|
-
./
old new 100 100 SYSLOG_AVAILABLE = False 101 101 102 102 from datetime import tzinfo, timedelta, datetime 103 103 from trac import config as trac_config 104 104 105 105 # Some global variables 106 106 # … … 997 997 print 'File %s does not exist' %file 998 998 sys.exit(1) 999 999 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) 1007 1001 1008 1002 # Use given project name else use defaults 1009 1003 # 1010 1004 if name: 1011 if not config.has_section(name): 1005 sections = config.sections() 1006 if not name in sections: 1012 1007 print "Not a valid project name: %s" %name 1013 print "Valid names: %s" % config.sections()1008 print "Valid names: %s" %sections 1014 1009 sys.exit(1) 1015 1010 1016 1011 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 1019 1014 1020 1015 else: 1021 1016 project = config.defaults()