started to fix remotes

This commit is contained in:
Andreas Preikschat 2013-07-13 17:27:19 +02:00
parent a091fe9395
commit aa7d45c09d
1 changed files with 10 additions and 10 deletions

View File

@ -445,7 +445,7 @@ class HttpRouter(object):
u'display': self.live_controller.desktop_screen.isChecked() u'display': self.live_controller.desktop_screen.isChecked()
} }
cherrypy.response.headers['Content-Type'] = u'application/json' cherrypy.response.headers['Content-Type'] = u'application/json'
return json.dumps({u'results': result}) return json.dumps({u'results': result}).encode()
def live_poll(self): def live_poll(self):
""" """
@ -455,7 +455,7 @@ class HttpRouter(object):
u'slide_count': self.live_controller.slide_count u'slide_count': self.live_controller.slide_count
} }
cherrypy.response.headers['Content-Type'] = u'application/json' cherrypy.response.headers['Content-Type'] = u'application/json'
return json.dumps({u'results': result}) return json.dumps({u'results': result}).encode()
def live_image(self): def live_image(self):
""" """
@ -465,7 +465,7 @@ class HttpRouter(object):
u'slide_image': u'data:image/png;base64,' + str(image_to_byte(self.live_controller.slide_image)) u'slide_image': u'data:image/png;base64,' + str(image_to_byte(self.live_controller.slide_image))
} }
cherrypy.response.headers['Content-Type'] = u'application/json' cherrypy.response.headers['Content-Type'] = u'application/json'
return json.dumps({u'results': result}) return json.dumps({u'results': result}).encode()
def display(self, action): def display(self, action):
""" """
@ -477,7 +477,7 @@ class HttpRouter(object):
""" """
self.live_controller.emit(QtCore.SIGNAL(u'slidecontroller_toggle_display'), action) self.live_controller.emit(QtCore.SIGNAL(u'slidecontroller_toggle_display'), action)
cherrypy.response.headers['Content-Type'] = u'application/json' cherrypy.response.headers['Content-Type'] = u'application/json'
return json.dumps({u'results': {u'success': True}}) return json.dumps({u'results': {u'success': True}}).encode()
def alert(self): def alert(self):
""" """
@ -495,7 +495,7 @@ class HttpRouter(object):
else: else:
success = False success = False
cherrypy.response.headers['Content-Type'] = u'application/json' cherrypy.response.headers['Content-Type'] = u'application/json'
return json.dumps({u'results': {u'success': success}}) return json.dumps({u'results': {u'success': success}}).encode()
def controller(self, display_type, action): def controller(self, display_type, action):
""" """
@ -543,7 +543,7 @@ class HttpRouter(object):
self.live_controller.emit(QtCore.SIGNAL(event)) self.live_controller.emit(QtCore.SIGNAL(event))
json_data = {u'results': {u'success': True}} json_data = {u'results': {u'success': True}}
cherrypy.response.headers['Content-Type'] = u'application/json' cherrypy.response.headers['Content-Type'] = u'application/json'
return json.dumps(json_data) return json.dumps(json_data).encode()
def service(self, action): def service(self, action):
""" """
@ -555,7 +555,7 @@ class HttpRouter(object):
event = u'servicemanager_%s' % action event = u'servicemanager_%s' % action
if action == u'list': if action == u'list':
cherrypy.response.headers['Content-Type'] = u'application/json' cherrypy.response.headers['Content-Type'] = u'application/json'
return json.dumps({u'results': {u'items': self._get_service_items()}}) return json.dumps({u'results': {u'items': self._get_service_items()}}).encode()
event += u'_item' event += u'_item'
if self.request_data: if self.request_data:
try: try:
@ -566,7 +566,7 @@ class HttpRouter(object):
else: else:
Registry().execute(event) Registry().execute(event)
cherrypy.response.headers['Content-Type'] = u'application/json' cherrypy.response.headers['Content-Type'] = u'application/json'
return json.dumps({u'results': {u'success': True}}) return json.dumps({u'results': {u'success': True}}).encode()
def plugin_info(self, action): def plugin_info(self, action):
""" """
@ -582,7 +582,7 @@ class HttpRouter(object):
if plugin.status == PluginStatus.Active and plugin.media_item and plugin.media_item.has_search: if plugin.status == PluginStatus.Active and plugin.media_item and plugin.media_item.has_search:
searches.append([plugin.name, unicode(plugin.text_strings[StringContent.Name][u'plural'])]) searches.append([plugin.name, unicode(plugin.text_strings[StringContent.Name][u'plural'])])
cherrypy.response.headers['Content-Type'] = u'application/json' cherrypy.response.headers['Content-Type'] = u'application/json'
return json.dumps({u'results': {u'items': searches}}) return json.dumps({u'results': {u'items': searches}}).encode()
def search(self, plugin_name): def search(self, plugin_name):
""" """
@ -602,7 +602,7 @@ class HttpRouter(object):
else: else:
results = [] results = []
cherrypy.response.headers['Content-Type'] = u'application/json' cherrypy.response.headers['Content-Type'] = u'application/json'
return json.dumps({u'results': {u'items': results}}) return json.dumps({u'results': {u'items': results}}).encode()
def go_live(self, plugin_name): def go_live(self, plugin_name):
""" """