kika: (Default)
[personal profile] kika
Ну вот как так можно написать, а? С той стороны приезжает JSON, я его парсю, нахожу в нем 'command', который 'exit' и в отладочной печати вижу "Now exiting the hive", но не вижу "Listener exits". И это нынче один из самых модных языков для разработки.

def listen(self):
        print "Listening"
        for change in self.changes:
            try:
                if not change.get(u'deleted'):
                    doc = change.get(u'doc')
                    if doc:
                        print doc
                        if doc.get(u'command') == u'exit':
                            print "Now exiting the hive"
                            break
            except:
                print "Exception in changes reader!"
        print "Listener exits"
From:
Anonymous( )Anonymous This account has disabled anonymous posting.
OpenID( )OpenID You can comment on this post while signed in with an account from many other sites, once you have confirmed your email address. Sign in using OpenID.
User
Account name:
Password:
If you don't have an account you can create one now.
Subject:
HTML doesn't work in the subject.

Message:

 
Notice: This account is set to log the IP addresses of everyone who comments.
Links will be displayed as unclickable URLs to help prevent spam.

Profile

kika: (Default)
kika

January 2017

S M T W T F S
1234567
89 1011121314
151617181920 21
22232425262728
293031    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 21st, 2017 12:21 pm
Powered by Dreamwidth Studios