2 from ConfigParser import SafeConfigParser
5 def get_config(tahoe_cfg):
6 config = SafeConfigParser()
7 f = open(tahoe_cfg, "rb")
9 # Skip any initial Byte Order Mark. Since this is an ordinary file, we
10 # don't need to handle incomplete reads, and can assume seekability.
11 if f.read(3) != '\xEF\xBB\xBF':
18 def set_config(config, section, option, value):
19 if not config.has_section(section):
20 config.add_section(section)
21 config.set(section, option, value)
22 assert config.get(section, option) == value
24 def write_config(tahoe_cfg, config):
25 f = open(tahoe_cfg, "wb")