Update src/configurator/manager.py
This commit is contained in:
@@ -4,13 +4,7 @@ __email__ = 'remizoffalex@mail.ru'
|
||||
|
||||
class Config:
|
||||
def __add__(self, other=None):
|
||||
print('self', self)
|
||||
print('other', len(other))
|
||||
if other:
|
||||
print('__add__', other)
|
||||
print(self.__value)
|
||||
print(other.__value)
|
||||
print(self.__value | other.__value)
|
||||
self.__value = self.__value | other.__value
|
||||
return self
|
||||
|
||||
@@ -33,8 +27,6 @@ class Config:
|
||||
def _getattr(obj, attr):
|
||||
pass
|
||||
|
||||
print(self.__value)
|
||||
print(key)
|
||||
if key=='items' and isinstance(self.__value, dict):
|
||||
return self.__value.items
|
||||
value = self.__value[key]
|
||||
@@ -45,8 +37,6 @@ class Config:
|
||||
return result
|
||||
|
||||
def __getitem__(self, key):
|
||||
print('__getitem__:', key)
|
||||
# if isinstance(self.__value, dict):
|
||||
value = self.__value[key]
|
||||
if isinstance(value, dict):
|
||||
result = Config(value)
|
||||
@@ -57,7 +47,6 @@ class Config:
|
||||
return result
|
||||
|
||||
def __iter__(self):
|
||||
print('__iter__', type(self.__value))
|
||||
if isinstance(self.__value, list):
|
||||
for value in self.__value:
|
||||
yield value
|
||||
|
||||
Reference in New Issue
Block a user