comparison web/log.py @ 184:cbe14244a372

a few fixes
author Matt Johnston <matt@ucc.asn.au>
date Thu, 06 Feb 2014 20:35:43 +0800
parents 177f616893e6
children adbf70d1449f
comparison
equal deleted inserted replaced
183:177f616893e6 184:cbe14244a372
267 267
268 r = [] 268 r = []
269 for k, v in _FIELD_DEFAULTS.iteritems(): 269 for k, v in _FIELD_DEFAULTS.iteritems():
270 n = {'name': k, 'value': v} 270 n = {'name': k, 'value': v}
271 if type(v) is bool: 271 if type(v) is bool:
272 if v:
273 n['value'] = "true"
274 kind = 'yesno' 272 kind = 'yesno'
275 else: 273 else:
276 kind = 'number' 274 kind = 'number'
277 n['amount'] = 0.1;
278 if k == 'overshoot_delay': 275 if k == 'overshoot_delay':
279 n['unit'] = ' sec' 276 n['unit'] = ' sec'
280 n['amount'] = 60 277 n['amount'] = 60
278 n['digits'] = 0;
281 else: 279 else:
282 n['unit'] = 'º' 280 n['unit'] = 'º'
281 n['amount'] = 0.1;
282 n['digits'] = 1;
283 n['kind'] = kind 283 n['kind'] = kind
284 n['title'] = k 284 n['title'] = k
285 r.append(n) 285 r.append(n)
286 286
287 return json.dumps(r, sort_keys=True, indent=4) 287 return json.dumps(r, sort_keys=True, indent=4)