Module Expr Str ImportFrom alias Import alias Import alias Import alias Import alias Import alias ImportFrom alias alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias alias alias alias alias alias alias alias ImportFrom alias ImportFrom alias Assign NameStore TupleLoad Str FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd BinOpAdd BinOpAdd BinOpAdd BinOpAdd NameLoad NameLoad NameLoad NameLoad Call NameLoad Num NameLoad NameLoad Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd NameLoad NameLoad NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr ListLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assert Call NameLoad NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body TryExcept body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad Str attr AttributeLoad NameLoad attr handlers ExceptHandler type AttributeLoad NameLoad attr name NameStore body Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Assign AttributeStore NameLoad attr ListLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Assert Call NameLoad NameLoad NameLoad Assert Call NameLoad NameLoad NameLoad Assert Call NameLoad NameLoad NameLoad Assert Call NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad keyword Num keyword Num Expr Call NameLoad NameLoad FunctionDef arguments args defaults body Return AttributeLoad NameLoad attr decorator_list Assign AttributeStore NameLoad attr Call NameLoad NameLoad keyword NameLoad Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assert Call NameLoad NameLoad NameLoad Assert BoolOpOr CompareIs NameLoad NameLoad Call NameLoad NameLoad Assign AttributeStore NameLoad attr Call NameLoad keyword NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore ListLoad Call NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assert Call NameLoad NameLoad NameLoad TryExcept body Assign NameStore Call AttributeLoad SubscriptLoad NameLoad Index Num attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Assign SubscriptStore NameLoad Index Num Call NameLoad Return Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Call NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr decorator_list Assign AttributeStore NameLoad attr Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assert Call NameLoad NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr If AttributeLoad AttributeLoad NameLoad attr attr body TryExcept body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr handlers ExceptHandler type TupleLoad NameLoad NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr Str AttributeLoad Call NameLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Return Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str NameLoad FunctionDef arguments args defaults body Assign AttributeStore NameLoad attr NameLoad TryFinally body If CompareIsNot AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad finalbody Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args defaults body Assign AttributeStore NameLoad attr NameLoad If UnaryOpNot AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index NameLoad attr Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Num Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assert Call NameLoad NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Raise NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Raise NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults Str Num NameLoad Str body Assert Call NameLoad NameLoad NameLoad Assert Call NameLoad NameLoad NameLoad Assert Call NameLoad NameLoad NameLoad Assert Call NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Num Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad Call AttributeLoad NameLoad attr keyword NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num Num Assign TupleStore NameStore AttributeStore NameLoad attr TupleLoad AttributeLoad NameLoad attr ListLoad For NameStore NameLoad body Expr Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr TryFinally body While NameLoad body Assign AttributeStore NameLoad attr Call NameLoad ListComp NameLoad comprehension NameStore AttributeLoad NameLoad attr UnaryOpNot AttributeLoad NameLoad attr Assign NameStore Call NameLoad ListComp NameLoad comprehension NameStore AttributeLoad NameLoad attr UnaryOpNot AttributeLoad NameLoad attr Assign NameStore BinOpAdd ListLoad NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num ListComp AttributeLoad NameLoad attr comprehension NameStore NameLoad Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad ListLoad ListLoad For NameStore NameLoad body If CompareEq NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse If CompareEq NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num body Expr Call AttributeLoad NameLoad attr orelse Expr Call AttributeLoad NameLoad attr NameLoad finalbody Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad NameLoad AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore SubscriptLoad ListComp NameLoad comprehension NameStore AttributeLoad NameLoad attr CompareEq AttributeLoad NameLoad attr NameLoad Index Num Assign NameStore Call AttributeLoad NameLoad attr Num If NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list decorator_list
N/A N/A 
Telnet server.

Example usage::

    class MyTelnetApplication(TelnetApplication):
        def client_connected(self, telnet_connection):
            # Set CLI with simple prompt.
            telnet_connection.set_application(
                telnet_connection.create_prompt_application(...))

        def handle_command(self, telnet_connection, document):
            # When the client enters a command, just reply.
            telnet_connection.send('You said: %r

' % document.text)

        ...

    a = MyTelnetApplication()
    TelnetServer(application=a, host='127.0.0.1', port=23).run()
 __future__ unicode_literals N/A socket N/A select N/A threading N/A os N/A fcntl six int2byte text_type binary_type codecs getincrementaldecoder prompt_toolkit.enums DEFAULT_BUFFER prompt_toolkit.eventloop.base EventLoop prompt_toolkit.interface CommandLineInterface Application prompt_toolkit.layout.screen Size prompt_toolkit.shortcuts create_prompt_application prompt_toolkit.terminal.vt100_input InputStream prompt_toolkit.terminal.vt100_output Vt100_Output log logger protocol IAC DO LINEMODE SB MODE SE WILL ECHO NAWS SUPPRESS_GO_AHEAD protocol TelnetProtocolParser application TelnetApplication N/A __all__ N/A TelnetServer _initialize_telnet N/A N/A connection N/A N/A N/A N/A N/A logger info Initializing telnet connection N/A N/A N/A connection send N/A N/A IAC DO LINEMODE N/A N/A N/A connection send N/A N/A IAC WILL SUPPRESS_GO_AHEAD N/A N/A N/A connection send N/A N/A N/A N/A N/A N/A IAC SB LINEMODE MODE N/A int2byte 0 IAC SE N/A N/A N/A connection send N/A N/A IAC WILL ECHO N/A N/A N/A connection send N/A N/A IAC DO NAWS N/A _ConnectionStdout N/A object N/A N/A 
    Wrapper around socket which provides `write` and `flush` methods for the
    Vt100_Output output.
     __init__ N/A N/A self connection encoding N/A N/A N/A N/A self _encoding encoding N/A N/A self _connection connection N/A N/A self _buffer N/A N/A write N/A N/A self data N/A N/A N/A N/A isinstance data text_type N/A N/A N/A N/A self _buffer append N/A N/A data encode N/A self _encoding N/A N/A N/A self flush N/A flush N/A N/A self N/A N/A N/A N/A N/A N/A N/A N/A self _connection send N/A N/A join N/A self _buffer N/A N/A N/A N/A socket error N/A e N/A N/A N/A N/A logger error N/A Couldn't send data over socket: %s e N/A N/A self _buffer N/A N/A N/A TelnetConnection N/A object N/A N/A 
    Class that represents one Telnet connection.
     __init__ N/A N/A self conn addr application server encoding N/A N/A N/A N/A isinstance addr tuple N/A N/A isinstance application TelnetApplication N/A N/A isinstance server TelnetServer N/A N/A isinstance encoding text_type N/A N/A self conn conn N/A N/A self addr addr N/A N/A self application application N/A N/A self closed False N/A N/A self handling_command True N/A N/A self server server N/A N/A self encoding encoding N/A N/A self callback None N/A N/A self size N/A Size rows 40 columns 79 N/A N/A _initialize_telnet conn get_size N/A N/A N/A N/A N/A N/A self size N/A N/A N/A self stdout N/A _ConnectionStdout conn encoding encoding N/A N/A self vt100_output N/A Vt100_Output N/A self stdout get_size N/A N/A self eventloop N/A _TelnetEventLoopInterface server N/A N/A N/A self set_application N/A create_prompt_application N/A N/A N/A application client_connected self N/A N/A self handling_command False N/A N/A N/A N/A self cli _redraw N/A set_application N/A N/A self app callback N/A None N/A N/A 
        Set ``CommandLineInterface`` instance for this connection.
        (This can be replaced any time.)

        :param cli: CommandLineInterface instance.
        :param callback: Callable that takes the result of the CLI.
         N/A N/A isinstance app Application N/A N/A N/A callback None N/A callable callback N/A N/A self cli N/A CommandLineInterface application app eventloop N/A self eventloop output N/A self vt100_output N/A N/A self callback callback N/A cb N/A N/A N/A self cli create_eventloop_callbacks N/A inputstream N/A InputStream N/A cb feed_key N/A stdin_decoder_cls N/A getincrementaldecoder N/A self encoding N/A stdin_decoder N/A N/A stdin_decoder_cls N/A N/A N/A self cli _is_running True data_received N/A N/A data N/A N/A N/A  TelnetProtocolParser 'data_received' callback  N/A N/A isinstance data binary_type N/A N/A N/A result N/A N/A N/A stdin_decoder N/A 0 decode data N/A N/A N/A inputstream feed result N/A N/A N/A UnicodeDecodeError N/A N/A N/A stdin_decoder N/A 0 N/A stdin_decoder_cls N/A N/A size_received N/A N/A rows columns N/A N/A N/A  TelnetProtocolParser 'size_received' callback  N/A N/A self size N/A Size rows rows columns columns N/A N/A N/A cb terminal_size_changed N/A N/A N/A self parser N/A TelnetProtocolParser data_received size_received N/A feed N/A N/A self data N/A N/A N/A 
        Handler for incoming data. (Called by TelnetServer.)
         N/A N/A isinstance data binary_type N/A N/A N/A N/A self parser feed data N/A N/A N/A N/A self cli _redraw N/A N/A N/A self cli is_returning N/A N/A N/A N/A return_value N/A N/A N/A self cli return_value N/A N/A N/A N/A EOFError KeyboardInterrupt N/A e N/A N/A N/A N/A logger info %s, closing connection. N/A N/A type e __name__ N/A N/A N/A self close N/A N/A N/A N/A self _handle_command return_value N/A _handle_command N/A N/A self command N/A N/A N/A 
        Handle command. This will run in a separate thread, in order not
        to block the event loop.
         N/A N/A N/A logger info Handle command %r command in_executor N/A N/A N/A N/A N/A N/A self handling_command True N/A N/A N/A N/A N/A self callback None N/A N/A N/A N/A self callback self command N/A N/A N/A N/A N/A self server call_from_executor done N/A done N/A N/A N/A N/A N/A N/A self handling_command False N/A N/A N/A self closed N/A N/A N/A N/A N/A self cli reset N/A N/A N/A N/A N/A N/A self cli buffers N/A DEFAULT_BUFFER reset N/A N/A N/A N/A N/A self cli renderer request_absolute_cursor_position N/A N/A N/A N/A self vt100_output flush N/A N/A N/A N/A self cli _redraw N/A N/A N/A N/A N/A self server run_in_executor in_executor N/A erase_screen N/A N/A self N/A N/A N/A 
        Erase output screen.
         N/A N/A N/A N/A self vt100_output erase_screen N/A N/A N/A N/A self vt100_output cursor_goto 0 0 N/A N/A N/A N/A self vt100_output flush N/A send N/A N/A self data N/A N/A N/A 
        Send text to the client.
         N/A N/A isinstance data text_type N/A N/A N/A N/A self stdout write N/A N/A data replace N/A N/A N/A N/A self stdout flush N/A close N/A N/A self N/A N/A N/A 
        Close the connection.
         N/A N/A N/A N/A self application client_leaving self N/A N/A N/A N/A self conn close N/A N/A self closed True N/A N/A _TelnetEventLoopInterface N/A EventLoop N/A N/A 
    Eventloop object to be assigned to `CommandLineInterface`.
     __init__ N/A N/A self server N/A N/A N/A N/A self _server server N/A close N/A N/A self N/A N/A N/A  Ignore.  N/A stop N/A N/A self N/A N/A N/A  Ignore.  N/A run_in_executor N/A N/A self callback N/A N/A N/A N/A N/A N/A self _server run_in_executor callback N/A call_from_executor N/A N/A self callback _max_postpone_until N/A None N/A N/A N/A N/A N/A self _server call_from_executor callback N/A add_reader N/A N/A self fd callback N/A N/A N/A NotImplementedError N/A remove_reader N/A N/A self fd N/A N/A N/A NotImplementedError N/A N/A TelnetServer N/A object N/A N/A 
    Telnet server implementation.
     __init__ N/A N/A self host port application encoding N/A 127.0.0.1 23 None utf-8 N/A N/A N/A isinstance host text_type N/A N/A isinstance port int N/A N/A isinstance application TelnetApplication N/A N/A isinstance encoding text_type N/A N/A self host host N/A N/A self port port N/A N/A self application application N/A N/A self encoding encoding N/A N/A self connections N/A set N/A N/A self _calls_from_executor N/A N/A N/A self _schedule_pipe N/A N/A os pipe N/A N/A N/A fcntl fcntl N/A N/A self _schedule_pipe N/A 0 N/A fcntl F_SETFL N/A os O_NONBLOCK N/A create_socket N/A N/A cls host port N/A N/A N/A s N/A N/A socket socket N/A socket AF_INET N/A socket SOCK_STREAM N/A N/A N/A s setsockopt N/A socket SOL_SOCKET N/A socket SO_REUSEADDR 1 N/A N/A N/A s bind N/A host port N/A N/A N/A s listen 4 N/A s N/A classmethod run_in_executor N/A N/A self callback N/A N/A N/A N/A N/A N/A N/A threading Thread target callback start N/A call_from_executor N/A N/A self callback N/A N/A N/A N/A N/A N/A self _calls_from_executor append callback N/A N/A self _schedule_pipe N/A N/A N/A N/A os write N/A N/A self _schedule_pipe N/A 1 x N/A _process_callbacks N/A N/A self N/A N/A N/A 
        Process callbacks from `call_from_executor` in eventloop.
         N/A N/A N/A os read N/A N/A self _schedule_pipe N/A 0 1024 N/A N/A calls_from_executor N/A self _calls_from_executor N/A N/A self _calls_from_executor N/A N/A c calls_from_executor N/A N/A N/A c N/A run N/A N/A self N/A N/A N/A 
        Run the eventloop for the telnet server.
         N/A listen_socket N/A N/A self create_socket N/A self host N/A self port N/A N/A N/A logger info Listening for telnet connections on %s port %r N/A self host N/A self port N/A N/A N/A True N/A N/A N/A self connections N/A set N/A c N/A c N/A self connections N/A N/A c closed N/A connections N/A set N/A c N/A c N/A self connections N/A N/A c handling_command N/A read_list N/A N/A listen_socket N/A N/A self _schedule_pipe N/A 0 N/A N/A c conn N/A c connections N/A N/A read _ _ N/A N/A select select read_list N/A N/A N/A s read N/A N/A N/A s listen_socket N/A N/A N/A N/A self _accept listen_socket N/A N/A N/A s N/A N/A self _schedule_pipe N/A 0 N/A N/A N/A N/A self _process_callbacks N/A N/A N/A N/A self _handle_incoming_data s N/A N/A N/A N/A listen_socket close N/A _accept N/A N/A self listen_socket N/A N/A N/A 
        Accept new incoming connection.
         N/A N/A conn addr N/A N/A listen_socket accept N/A connection N/A TelnetConnection conn addr N/A self application self encoding N/A self encoding N/A N/A N/A N/A self connections add connection N/A N/A N/A logger info New connection %r %r addr N/A _handle_incoming_data N/A N/A self conn N/A N/A N/A 
        Handle incoming data on socket.
         N/A connection N/A N/A c N/A c N/A self connections N/A N/A c conn conn N/A 0 N/A data N/A N/A conn recv 1024 N/A data N/A N/A N/A N/A connection feed data N/A N/A N/A N/A N/A self connections remove connection N/A N/A