Beispiel #1
0
    def dump_key(key, subs):
        values = []

        for path, value in rc.config.flatten():

            dot_path = '.'.join(path)
            if key:
                if key == dot_path: # Exact matches
                    return sub_value(value, subs)

                elif dot_path.startswith(key):
                    values.append((dot_path.split('.'), sub_value(value, subs) ))

            else:
                return ''.join(dot_path, '=', sub_value(value, subs))


        if not values:
            return

        d = AttrDict()

        d.update_flat(values)

        return d