import _fireinfo
-import bios
-import cpu
-import device
-import hypervisor
-import network
+from . import bios
+from . import cpu
+from . import device
+from . import hypervisor
+from . import network
PROFILE_VERSION = 0
except IOError:
pass
-class System(object):
- __metaclass__ = Singleton
-
+class System(object, metaclass=Singleton):
def __init__(self):
self.bios = bios.BIOS(self)
if s is None:
return
- return filter(lambda x: x in string.printable, s)
+ return [x for x in s if x in string.printable]
@property
def vendor(self):
ret = read_from_file("/proc/device-tree/model")
if ret:
# replace the NULL byte with which the DT string ends
- ret = ret.replace(u"\u0000", "")
+ ret = ret.replace("\u0000", "")
# Fall back to read /proc/cpuinfo
if not ret:
if __name__ == "__main__":
s=System()
- print s.arch
- print s.language
- print s.release
- print s.bios_vendor
- print s.memory
- print s.kernel
- print s.root_disk
- print s.root_size
- print "------------\n", s.devices, "\n------------\n"
- print json.dumps(s.profile(), sort_keys=True, indent=4)
+ print(s.arch)
+ print(s.language)
+ print(s.release)
+ print(s.bios_vendor)
+ print(s.memory)
+ print(s.kernel)
+ print(s.root_disk)
+ print(s.root_size)
+ print("------------\n", s.devices, "\n------------\n")
+ print(json.dumps(s.profile(), sort_keys=True, indent=4))