Exemple #1
0
def parse_string(text, profile=None, **kwargs):
    text = dedent(text)
    f = StringIO(text)
    if profile:
        return parse_conf(f, profile)
    else:
        return parse_conf_stream(f, **kwargs)
Exemple #2
0
 def get_conf(self, profile=None, **kwargs):
     """ Parse stdout as a .conf file"""
     f = StringIO(self.stdout)
     if profile:
         return parse_conf(f, profile)
     else:
         return parse_conf_stream(f, **kwargs)