コード例 #1
0
ファイル: helper.py プロジェクト: Nukesor/pueue
def send_command(command):
    client = connect_client_socket()
    client.send(pickle.dumps(command, -1))
    answer = client.recv(1048576)
    response = pickle.loads(answer)
    client.close()
    return response
コード例 #2
0
ファイル: displaying.py プロジェクト: Nukesor/pueue
def get_status():
    # Initialize socket, message and send it
    client = connect_client_socket()
    instruction = {'mode': 'status'}
    data_string = pickle.dumps(instruction, -1)
    client.send(data_string)

    response = receive_data(client)
    return response
コード例 #3
0
ファイル: factories.py プロジェクト: Nukesor/pueue
    def change_state(instruction):
        # Initialize socket, message and send it
        client = connect_client_socket()
        instruction['mode'] = state
        instruction['func'] = None
        data_string = pickle.dumps(instruction, -1)
        client.send(data_string)

        # Receive message and print it
        response = receive_data(client)
        process_response(response)
コード例 #4
0
ファイル: manipulation.py プロジェクト: Nukesor/pueue
def execute_send(args):
    client = connect_client_socket()

    # Send new instruction to daemon
    instruction = {"mode": "send", "input": args["input"]}
    data_string = pickle.dumps(instruction, -1)
    client.send(data_string)

    # Receive Answer from daemon and print it
    response = receive_data(client)
    process_response(response)
コード例 #5
0
ファイル: manipulation.py プロジェクト: Nukesor/pueue
def execute_add(args):
    client = connect_client_socket()

    # Send new instruction to daemon
    instruction = {"mode": "add", "command": args["command"], "path": os.getcwd()}
    data_string = pickle.dumps(instruction, -1)
    client.send(data_string)

    # Receive Answer from daemon and print it
    response = receive_data(client)
    process_response(response)