Skip to content

Commit d8e8181

Browse files
committed
[SystemInfo] remove SystemInformation class as it doesn't function like a real dict and cause more problems than it solves
1 parent ba041e8 commit d8e8181

File tree

1 file changed

+2
-28
lines changed

1 file changed

+2
-28
lines changed

lib/python/Components/SystemInfo.py

+2-28
Original file line numberDiff line numberDiff line change
@@ -70,34 +70,8 @@ def deleteItem(self, item):
7070

7171
BoxInfo = BoxInformation()
7272

73-
74-
class SystemInformation(dict):
75-
def __getitem__(self, item):
76-
return BoxInfo.boxInfo[item]
77-
78-
def __setitem__(self, item, value):
79-
BoxInfo.setItem(item, value, immutable=False)
80-
81-
def __delitem__(self, item):
82-
BoxInfo.deleteItem(item)
83-
84-
def get(self, item, default=None):
85-
return BoxInfo.boxInfo.get(item, default)
86-
87-
def __prohibited(self, *args, **kws):
88-
print("[SystemInfo] operation not permitted")
89-
90-
def __contains__(self, item):
91-
return item in BoxInfo.boxInfo
92-
93-
clear = __prohibited
94-
update = __prohibited
95-
setdefault = __prohibited
96-
pop = __prohibited
97-
popitem = __prohibited
98-
99-
100-
SystemInfo = SystemInformation()
73+
#This line makes the BoxInfo backwards compatible with SystemInfo without duplicating the dictionary.
74+
SystemInfo = BoxInfo.boxInfo
10175

10276

10377
ARCHITECTURE = BoxInfo.getItem("architecture")

0 commit comments

Comments
 (0)