fix bug with none type value

This commit is contained in:
arcan1s
2014-04-05 18:53:22 +04:00
parent 2675beb106
commit f21fea1393
2 changed files with 6 additions and 5 deletions

View File

@ -497,6 +497,8 @@ class pyTextWidget(plasmascript.Applet):
def dataUpdated(self, sourceName, data):
"""function to update label"""
updatedData = self.dataengine.dataUpdated(str(sourceName), data, self.ptm)
if (updatedData['value'] == None):
return
# update falues where is needed
if (updatedData['type'] != None):
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']):
self.ptm['tooltip']['values'][updatedData['name']] = self.ptm['tooltip']['values'][updatedData['name']][1:]
if ((updatedData['name'] in ['cpu', 'cpuclock']) and (updatedData['type'] == -1)):
print (updatedData['value'])
self.ptm['tooltip']['values'][updatedData['name']].append(updatedData['value'])
elif ((updatedData['name'] == "mem") and (updatedData['type'] == "app")):
self.ptm['tooltip']['values'][updatedData['name']].append(updatedData['value'])