Ticket #36: email2trac.0.13.diff
File email2trac.0.13.diff, 1.1 KB (added by andrei2102@…, 16 years ago) |
---|
-
./email2trac.py
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 # … … 1023 1023 print 'File %s does not exist' %file 1024 1024 sys.exit(1) 1025 1025 1026 config = ConfigParser.ConfigParser() 1027 try: 1028 config.read(file) 1029 except ConfigParser.MissingSectionHeaderError,detail: 1030 print detail 1031 sys.exit(1) 1032 1026 config = trac_config.Configuration(file) 1033 1027 1034 1028 # Use given project name else use defaults 1035 1029 # 1036 1030 if name: 1037 if not config.has_section(name): 1031 sections = config.sections() 1032 if not name in sections: 1038 1033 print "Not a valid project name: %s" %name 1039 print "Valid names: %s" % config.sections()1034 print "Valid names: %s" %sections 1040 1035 sys.exit(1) 1041 1036 1042 1037 project = dict() 1043 for option in config.options(name):1044 project[option] = config.get(name, option)1038 for option, value in config.options(name): 1039 project[option] = value 1045 1040 1046 1041 else: 1047 1042 project = config.defaults()