1 | 95c95 |
---|
2 | < |
---|
3 | --- |
---|
4 | > from trac import config as trac_config |
---|
5 | 955,960c951 |
---|
6 | < config = ConfigParser.ConfigParser() |
---|
7 | < try: |
---|
8 | < config.read(file) |
---|
9 | < except ConfigParser.MissingSectionHeaderError,detail: |
---|
10 | < print detail |
---|
11 | < sys.exit(1) |
---|
12 | --- |
---|
13 | > config = trac_config.Configuration(file) |
---|
14 | 966c957,958 |
---|
15 | < if not config.has_section(name): |
---|
16 | --- |
---|
17 | > sections = config.sections() |
---|
18 | > if not name in sections: |
---|
19 | 968c960 |
---|
20 | < print "Valid names: %s" %config.sections() |
---|
21 | --- |
---|
22 | > print "Valid names: %s" %sections |
---|
23 | 972,973c964,965 |
---|
24 | < for option in config.options(name): |
---|
25 | < project[option] = config.get(name, option) |
---|
26 | --- |
---|
27 | > for option, value in config.options(name): |
---|
28 | > project[option] = value |
---|
29 | 1048c1040 |
---|
30 | < from trac import attachment |
---|
31 | --- |
---|
32 | > from trac import attachment |
---|