mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/idf_py_fix_property_dict' into 'master'
idf.py: Fix PropertyDict implementation See merge request espressif/esp-idf!5775
This commit is contained in:
commit
f4763a3e1a
17
tools/idf.py
17
tools/idf.py
@ -540,9 +540,20 @@ def get_default_serial_port():
|
||||
|
||||
|
||||
class PropertyDict(dict):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(PropertyDict, self).__init__(*args, **kwargs)
|
||||
self.__dict__ = self
|
||||
def __getattr__(self, name):
|
||||
if name in self:
|
||||
return self[name]
|
||||
else:
|
||||
raise AttributeError("'PropertyDict' object has no attribute '%s'" % name)
|
||||
|
||||
def __setattr__(self, name, value):
|
||||
self[name] = value
|
||||
|
||||
def __delattr__(self, name):
|
||||
if name in self:
|
||||
del self[name]
|
||||
else:
|
||||
raise AttributeError("'PropertyDict' object has no attribute '%s'" % name)
|
||||
|
||||
|
||||
def init_cli():
|
||||
|
Loading…
x
Reference in New Issue
Block a user