mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-25 07:57:19 +00:00
fix bug with none type value
This commit is contained in:
parent
2675beb106
commit
f21fea1393
@ -85,8 +85,7 @@ class DataEngine:
|
|||||||
interval = ptm['vars']['app']['interval']
|
interval = ptm['vars']['app']['interval']
|
||||||
names = ptm['names']
|
names = ptm['names']
|
||||||
updatedData = {'name':None, 'type':None, 'value':None}
|
updatedData = {'name':None, 'type':None, 'value':None}
|
||||||
if True:
|
try:
|
||||||
#try:
|
|
||||||
if (sourceName == "cpu/system/TotalLoad"):
|
if (sourceName == "cpu/system/TotalLoad"):
|
||||||
updatedData['name'] = "cpu"
|
updatedData['name'] = "cpu"
|
||||||
updatedData['type'] = -1
|
updatedData['type'] = -1
|
||||||
@ -240,9 +239,8 @@ class DataEngine:
|
|||||||
updatedData['value'] = "%s%02i%s" % (updatedData['value'].split('$mm')[0], minutes, updatedData['value'].split('$mm')[1])
|
updatedData['value'] = "%s%02i%s" % (updatedData['value'].split('$mm')[0], minutes, updatedData['value'].split('$mm')[1])
|
||||||
if (updatedData['value'].split('$m')[0] != updatedData['value']):
|
if (updatedData['value'].split('$m')[0] != updatedData['value']):
|
||||||
updatedData['value'] = "%s%2i%s" % (updatedData['value'].split('$m')[0], minutes, updatedData['value'].split('$m')[1])
|
updatedData['value'] = "%s%2i%s" % (updatedData['value'].split('$m')[0], minutes, updatedData['value'].split('$m')[1])
|
||||||
#except:
|
except:
|
||||||
#pass
|
pass
|
||||||
|
|
||||||
return updatedData
|
return updatedData
|
||||||
|
|
||||||
|
|
||||||
|
@ -497,6 +497,8 @@ class pyTextWidget(plasmascript.Applet):
|
|||||||
def dataUpdated(self, sourceName, data):
|
def dataUpdated(self, sourceName, data):
|
||||||
"""function to update label"""
|
"""function to update label"""
|
||||||
updatedData = self.dataengine.dataUpdated(str(sourceName), data, self.ptm)
|
updatedData = self.dataengine.dataUpdated(str(sourceName), data, self.ptm)
|
||||||
|
if (updatedData['value'] == None):
|
||||||
|
return
|
||||||
# update falues where is needed
|
# update falues where is needed
|
||||||
if (updatedData['type'] != None):
|
if (updatedData['type'] != None):
|
||||||
self.ptm['values'][updatedData['name']][updatedData['type']] = updatedData['value']
|
self.ptm['values'][updatedData['name']][updatedData['type']] = updatedData['value']
|
||||||
@ -515,6 +517,7 @@ class pyTextWidget(plasmascript.Applet):
|
|||||||
if (len(self.ptm['tooltip']['values'][updatedData['name']]) > self.ptm['vars']['tooltip']['num']):
|
if (len(self.ptm['tooltip']['values'][updatedData['name']]) > self.ptm['vars']['tooltip']['num']):
|
||||||
self.ptm['tooltip']['values'][updatedData['name']] = self.ptm['tooltip']['values'][updatedData['name']][1:]
|
self.ptm['tooltip']['values'][updatedData['name']] = self.ptm['tooltip']['values'][updatedData['name']][1:]
|
||||||
if ((updatedData['name'] in ['cpu', 'cpuclock']) and (updatedData['type'] == -1)):
|
if ((updatedData['name'] in ['cpu', 'cpuclock']) and (updatedData['type'] == -1)):
|
||||||
|
print (updatedData['value'])
|
||||||
self.ptm['tooltip']['values'][updatedData['name']].append(updatedData['value'])
|
self.ptm['tooltip']['values'][updatedData['name']].append(updatedData['value'])
|
||||||
elif ((updatedData['name'] == "mem") and (updatedData['type'] == "app")):
|
elif ((updatedData['name'] == "mem") and (updatedData['type'] == "app")):
|
||||||
self.ptm['tooltip']['values'][updatedData['name']].append(updatedData['value'])
|
self.ptm['tooltip']['values'][updatedData['name']].append(updatedData['value'])
|
||||||
|
Loading…
Reference in New Issue
Block a user