Make the json consistant, ints for ints, strings for strings

This commit is contained in:
2011-08-10 15:58:13 +01:00
parent f76809db7a
commit 6c986e8572
2 changed files with 6 additions and 6 deletions

View File

@@ -76,12 +76,12 @@ class OAuthOpTimerHandler(BaseHandler):
if endsIn > 0: if endsIn > 0:
event = { event = {
'startsIn': startsIn, 'startsIn': startsIn,
'eventID': node.getAttribute('eventID'), 'eventID': int(node.getAttribute('eventID')),
'ownerName': node.getAttribute('ownerName'), 'ownerName': node.getAttribute('ownerName'),
'eventDate': date, 'eventDate': date,
'eventTitle': node.getAttribute('eventTitle'), 'eventTitle': node.getAttribute('eventTitle'),
'duration': duration, 'duration': duration,
'isImportant': node.getAttribute('importance'), 'isImportant': int(node.getAttribute('importance')),
'eventText': node.getAttribute('eventText'), 'eventText': node.getAttribute('eventText'),
'endsIn':endsIn, 'endsIn':endsIn,
'forumLink': forumlink} 'forumLink': forumlink}
@@ -90,12 +90,12 @@ class OAuthOpTimerHandler(BaseHandler):
if len(events) == 0: if len(events) == 0:
return {'ops':[{ return {'ops':[{
'startsIn': -1, 'startsIn': -1,
'eventID': '0', 'eventID': 0,
'ownerName': '', 'ownerName': '',
'eventDate': '', 'eventDate': '',
'eventTitle': '<div style="text-align:center">No ops are currently scheduled</div>', 'eventTitle': '<div style="text-align:center">No ops are currently scheduled</div>',
'duration': 0, 'duration': 0,
'isImportant': '0', 'isImportant': 0,
'eventText': 'Add ops using EVE-Gate or the in-game calendar', 'eventText': 'Add ops using EVE-Gate or the in-game calendar',
'endsIn':-1, 'endsIn':-1,
'forumLink': ''}]} 'forumLink': ''}]}

View File

@@ -170,12 +170,12 @@ class OpTimerHandler(BaseHandler):
if endsIn > 0: if endsIn > 0:
event = { event = {
'startsIn': startsIn, 'startsIn': startsIn,
'eventID': node.getAttribute('eventID'), 'eventID': int(node.getAttribute('eventID')),
'ownerName': node.getAttribute('ownerName'), 'ownerName': node.getAttribute('ownerName'),
'eventDate': date, 'eventDate': date,
'eventTitle': node.getAttribute('eventTitle'), 'eventTitle': node.getAttribute('eventTitle'),
'duration': duration, 'duration': duration,
'isImportant': node.getAttribute('importance'), 'isImportant': int(node.getAttribute('importance')),
'eventText': node.getAttribute('eventText'), 'eventText': node.getAttribute('eventText'),
'endsIn':endsIn, 'endsIn':endsIn,
'forumLink': forumlink} 'forumLink': forumlink}