示例#1
0
    def __init__(self, data=None):
        def _normalize(d):
            for k, v in list(d.items()):
                if isinstance(v, dict) and not isinstance(v, ConfigDict):
                    yield k, ConfigDict(v)
                else:
                    yield k, v

        if data:
            if isinstance(data, ConfigDict):
                MergableDict.__init__(self, data)
            else:
                MergableDict.__init__(self, _normalize(data))
        else:
            MergableDict.__init__(self)
        ConfigNode.__init__(self)
示例#2
0
    def __init__(self, data=None):

        def _normalize(d):
            for k, v in list(d.items()):
                if isinstance(v, dict) and not isinstance(v, ConfigDict):
                    yield k, ConfigDict(v)
                else:
                    yield k, v

        if data:
            if isinstance(data, ConfigDict):
                MergableDict.__init__(self, data)
            else:
                MergableDict.__init__(self, _normalize(data))
        else:
            MergableDict.__init__(self)
        ConfigNode.__init__(self)
示例#3
0
 def copy(self):
     return ConfigDict(MergableDict.copy(self))
示例#4
0
 def copy(self):
     return ConfigDict(MergableDict.copy(self))