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

@ -85,8 +85,7 @@ class DataEngine:
interval = ptm['vars']['app']['interval']
names = ptm['names']
updatedData = {'name':None, 'type':None, 'value':None}
if True:
#try:
try:
if (sourceName == "cpu/system/TotalLoad"):
updatedData['name'] = "cpu"
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])
if (updatedData['value'].split('$m')[0] != updatedData['value']):
updatedData['value'] = "%s%2i%s" % (updatedData['value'].split('$m')[0], minutes, updatedData['value'].split('$m')[1])
#except:
#pass
except:
pass
return updatedData