/usr/lib/gdesklets/utils/Struct.py is in gdesklets 0.36.1-5+b1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | # from libdesklets.system.gtop import _Struct as Struct
class Struct(dict):
"""
Class for smart handling a bunch of data.
The following is a example
>>> s = Struct(spam=42, egg=range(3))
>>> print s, s.spam, s.egg
{'egg': [0, 1, 2], 'spam': 42} 42 [0, 1, 2]
>>> stat = get_system_information()
>>> display(stat.info1)
"""
__slots__ = ()
def __getattr__(self, name):
return self[name]
def __repr__(self):
s = 'Struct {'
items = self.items()
items.sort()
for k, v in items:
s += ' .%s = %s,' % (k, v)
if s[-1] == ',':
s = s[:-1]
s += ' }'
return s
def __hash__(self):
return hash(repr(self))
|