view tests/data/conf_perf.py @ 552:39e5d07d8dbc

Provide a C implementation of configmix.config._split_filters. This is needed as precondition for implementation interpolate_variables in C also. Currently the speedup is not measurable but it does not hurt also. Also provide some unit-tests for _split_filters().
author Franz Glasner <fzglas.hg@dom66.de>
date Sun, 02 Jan 2022 20:40:09 +0100
parents c2947ac74b0c
children 09e15af29d36
line wrap: on
line source

# -*- coding: utf-8 -*-

__all__ = ["key1", "key2", "tree1"]


try:
    from collections import OrderedDict
except ImportError:
    from ordereddict import OrderedDict
    

key1 = u"in the root namespace"
key2 = u"in the root namespace -- too"

tree1 = OrderedDict([
    (u'key3',  0x20),
    
    (u'tree2', OrderedDict([
        (u'key4', u"get this as `tree1.tree2.key4'"),
        (u'key5', True),
        (u'key6', u"off"),
        (u'key7', []),
        (u'key8', [
            u"val1",
            u"val2",
            u"{{key1}}"
        ]),
        (u'key9', OrderedDict()),
        (u'key10', u"1{{key1}}2{{key2}}{{key1}}3{{tree1.tree2.key4}}"),
        (u"key11", u"{{tree1.tree2.key6}}"),
        (u"key12", u"{{PY:version}}"),
        (u"key13", u"{{tree1.key3}}__{{PY:version}}"),
    ]))])