コード例 #1
0
class ConsoleListener(object):
    '''
    classdocs
    '''


    def __init__(self):
        '''
        Constructor
        '''
        self._command_received = Event();


    def on_command_received(self):
        return self._command_received

    def listen(self):
        stop = False
        print 'ConsoleListener: listening... [type "stop" + Enter to stop]'
        while not stop:
            userinput = stdin.readline().strip()
            print 'user input: "%s"' % userinput
            if userinput == 'stop':
                stop = True
                break

            self._command_received.notify(userinput)
        print 'ConsoleListener: stopped.'
コード例 #2
0
class ConsoleListener(object):
    '''
    classdocs
    '''
    def __init__(self):
        '''
        Constructor
        '''
        self._command_received = Event()

    def on_command_received(self):
        return self._command_received

    def listen(self):
        stop = False
        print 'ConsoleListener: listening... [type "stop" + Enter to stop]'
        while not stop:
            userinput = stdin.readline().strip()
            print 'user input: "%s"' % userinput
            if userinput == 'stop':
                stop = True
                break

            self._command_received.notify(userinput)
        print 'ConsoleListener: stopped.'
コード例 #3
0
 def __init__(self):
     '''
     Constructor
     '''
     self._command_received = Event();
コード例 #4
0
 def __init__(self):
     '''
     Constructor
     '''
     self._command_received = Event()