# Regular expressions for parsing section headers and options
_SECT_TMPL = r"""
\[ # [
- (?P<header>[^]]+) # very permissive!
+ (?P<header>.+) # very permissive!
\] # ]
"""
_OPT_TMPL = r"""
'Spacey Bar',
'Spacey Bar From The Beginning',
'Types',
+ 'This One Has A ] In It',
]
if self.allow_no_value:
eq(cf.get('Types', 'float'), "0.44")
eq(cf.getboolean('Types', 'boolean'), False)
eq(cf.get('Types', '123'), 'strange but acceptable')
+ eq(cf.get('This One Has A ] In It', 'forks'), 'spoons')
if self.allow_no_value:
eq(cf.get('NoValue', 'option-without-value'), None)
float {0[0]} 0.44
boolean {0[0]} NO
123 {0[1]} strange but acceptable
+[This One Has A ] In It]
+ forks {0[0]} spoons
""".format(self.delimiters, self.comment_prefixes)
if self.allow_no_value:
config_string += (
"boolean": False,
123: "strange but acceptable",
},
+ "This One Has A ] In It": {
+ "forks": "spoons"
+ },
}
if self.allow_no_value:
config.update({