Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions sysmontask/cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@ def cpuInit(self):
self.cpuFanSpeedLabelValue=self.builder.get_object('cpufanspeedlabelvalue')
self.cpuMxSpeedLabelValue=self.builder.get_object('cpumxspeedlabelvalue')

# Get the name of the CPU
try:
## for the first time only to get the name of the cpu
p=popen('cat /proc/cpuinfo |grep -m1 "model name"')
self.cpuname=p.read().split(':')[1].split('\n')[0]
with open("/proc/cpuinfo") as cpuinfo:
for line in cpuinfo:
if line.startswith('model name'):
self.cpuname = line.split(':')[1].strip()
break
self.cpuInfoLabel.set_text(self.cpuname)
self.cpuInfoLabel.set_valign(g.Align.CENTER)
p.close()
except:
print("Failed to get model information")

Expand Down Expand Up @@ -226,4 +228,4 @@ def cpuUpdate(self):
self.cpuUtilArray.insert(0,self.cpuUtil)
for i in range(self.cpu_logical_cores):
self.cpu_logical_cores_util_arrays[i].pop()
self.cpu_logical_cores_util_arrays[i].insert(0,temp[i])
self.cpu_logical_cores_util_arrays[i].insert(0,temp[i])
9 changes: 5 additions & 4 deletions sysmontask/mem.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@ def memorytabinit(self):

# Getting the Corrupted memory info
try:
p=popen('cat /proc/meminfo | grep -E -i "corrupted"')
tempcourrupted=p.read().split(':')[1]
p.close()
self.memCourruptedLabelValue.set_text(re.sub('\s','',tempcourrupted))
with open("/proc/meminfo") as meminfo:
for line in meminfo:
if line.startswith('HardwareCorrupted'):
self.memCourruptedLabelValue.set_text(line.split(':')[1].strip())
break
except:
print("Failed to get Corrupted Memory")

Expand Down