Module Expr Str Import alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If UnaryOpNot AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr NameLoad orelse AugAssignAdd AttributeStore NameLoad attr NameLoad Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr Str SubscriptLoad AttributeLoad NameLoad attr Slice Num Index Num If CompareEq BinOpSub Call NameLoad AttributeLoad NameLoad attr Num NameLoad body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Slice Num Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad If BoolOpAnd AttributeLoad NameLoad attr CompareEq AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad orelse Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str NameLoad Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Str Call NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpAdd NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr BinOpAdd Str Call NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr 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 AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Lambda arguments args defaults AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If AttributeLoad AttributeLoad NameLoad attr attr body Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad orelse Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list decorator_list
N/A N/A 
Client code for handling connecting to the Minecraft server and switching
between greenlet execution contexts.
 N/A struct N/A sys N/A logging N/A asyncio greenlet greenlet api robotapi_pb2 RobotClientProtocol N/A N/A asyncio Protocol N/A N/A Protocol for sending requests to the Robot control API.

    Includes adding (and checking) the 4-byte length integer at the start of
    every packet and serializing/deserializing the protobuffer request and
    response objects. __init__ N/A N/A self context_handler N/A N/A N/A N/A self context_handler context_handler N/A N/A self last_sent_request None N/A N/A self response_data None N/A N/A self transport None N/A data_received N/A N/A self data N/A N/A N/A Overrides Protocol method, to handle incoming data. N/A N/A N/A self response_data N/A N/A N/A self response_data data N/A N/A N/A self response_data data N/A expect_len N/A N/A N/A struct unpack !L N/A N/A self response_data N/A 4 N/A 0 N/A N/A N/A N/A len N/A self response_data 4 expect_len N/A N/A payload N/A N/A self response_data N/A 4 N/A N/A self response_data None N/A N/A N/A self process_payload payload N/A process_payload N/A N/A self msg N/A N/A N/A Processes a fully receieved payload proto. N/A response N/A N/A robotapi_pb2 RobotResponse N/A N/A N/A response ParseFromString msg N/A N/A N/A logging debug Received response:
<
%s> response N/A N/A N/A self last_sent_request N/A N/A N/A self last_sent_request key N/A response key N/A N/A N/A N/A N/A self context_handler handle_response response N/A N/A N/A N/A logging warn Recieved extra response for a retry. Response was for key: %s but I expected key %s. N/A response key N/A N/A self last_sent_request key N/A send_request N/A N/A self request N/A N/A N/A Serialize and send the given proto request object. N/A N/A N/A logging debug Sending request:
<
%s> request N/A N/A self last_sent_request request N/A payload N/A N/A request SerializeToString N/A size N/A N/A struct pack !L N/A len payload N/A N/A N/A N/A self transport write N/A size payload N/A connection_made N/A N/A self transport N/A N/A N/A Overrides Protocol method, called when the connection to the server
        is established. N/A N/A N/A logging info Connected to server. N/A N/A self transport transport N/A N/A N/A N/A self context_handler trigger_first_request self N/A connection_lost N/A N/A self reason N/A N/A N/A Overrides Protocol method, called when the connection to the server
        is lost. N/A N/A N/A logging warn N/A Connection to server lost. Reason:  N/A str reason N/A N/A ContextHandler N/A object N/A N/A Class that controls switching between two execution contexts (using
    greenlets).

    When waiting for the server to connect, it starts off in the network
    greenlet, when the server connects it switches back to the robot
    greenlet for it to work out what the first network request will be. When
    it sends a request, we switch back to the network greenlet to send it
    and asynchronously wait for the response. When the response is receieved
    we switch back to the robot greenlet to await the next request. __init__ N/A N/A self host port N/A N/A N/A N/A self loop N/A N/A asyncio get_event_loop N/A N/A self host host N/A N/A self port port N/A N/A self network_greenlet None N/A N/A self protocol None N/A N/A self robot_greenlet N/A N/A greenlet getcurrent N/A N/A self network_greenlet N/A greenlet N/A self _run_event_loop N/A N/A N/A N/A self network_greenlet switch N/A trigger_first_request N/A N/A self protocol N/A N/A N/A Once the server connection is made, this is called to swtich to the
        robot greenelt to get the first request. N/A N/A N/A logging debug Connected. Waiting for first robot request... N/A N/A self protocol protocol N/A request N/A N/A N/A self robot_greenlet switch N/A N/A N/A N/A self protocol send_request request N/A _run_event_loop N/A N/A self N/A N/A N/A Start the main asyncio event loop (must be in the network greenlet).
         N/A N/A self protocol N/A RobotClientProtocol self N/A N/A N/A asyncio async N/A N/A N/A self loop create_connection N/A N/A N/A N/A N/A self protocol host N/A self host port N/A self port N/A N/A N/A N/A self loop run_forever N/A N/A N/A N/A self loop close N/A send_request N/A N/A self request N/A N/A N/A Switch to the network context and send the given proto request
        object. N/A N/A N/A self network_greenlet dead N/A N/A N/A N/A sys exit Goodbye. N/A response N/A N/A N/A self network_greenlet switch request N/A response N/A handle_response N/A N/A self response N/A N/A N/A Accept the response proto object and switch back to the robot
        greenlet to process it before returning it to the user's code. N/A request N/A N/A N/A self robot_greenlet switch response N/A request N/A N/A N/A N/A N/A self protocol send_request request N/A N/A N/A N/A logging info Received null request, ending. N/A N/A N/A N/A self loop stop N/A N/A