def title_changed(self, widget, frame, title):
if title != 'null':
self.message_queue.put(title)
while Gtk.events_pending():
Gtk.main_iteration()
msg = self.web_recv()
if msg:
try:
msg = from_json(msg)
print('This is the message %s' % (msg))
if msg['status'] == 'ready':
self.web_send('title="%s";subtitle="%s";humidity=%s;\
cloudiness=%s;temperature=%s;draw_graph(title,subtitle,temperature,humidity,\
cloudiness);' % (self.title, self.subtitle, self.humidity, self.cloudiness,
self.temperature))
elif msg['status'] == 'exit':
self.close_application(None)
except BaseException:
pass
评论列表
文章目录