Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# nipanel-python
Source for the nipanel python package

# Generated code
This is the command to generate the files in \generated\python_panel_service\_stubs:
`poetry run python -m grpc_tools.protoc --proto_path=src/codegen/protos --python_out=generated/python_panel_service/_stubs --grpc_python_out=generated/python_panel_service/_stubs src/codegen/protos/python_panel_service.proto`
43 changes: 43 additions & 0 deletions generated/python_panel_service/_stubs/python_panel_service_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

180 changes: 180 additions & 0 deletions generated/python_panel_service/_stubs/python_panel_service_pb2_grpc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

import python_panel_service_pb2 as python__panel__service__pb2


class PythonPanelServiceStub(object):
"""Service interface for connecting to python panels
"""

def __init__(self, channel):
"""Constructor.

Args:
channel: A grpc.Channel.
"""
self.Connect = channel.unary_unary(
'/ni.pythonpanel.v1.PythonPanelService/Connect',
request_serializer=python__panel__service__pb2.ConnectRequest.SerializeToString,
response_deserializer=python__panel__service__pb2.ConnectResponse.FromString,
)
self.Disconnect = channel.unary_unary(
'/ni.pythonpanel.v1.PythonPanelService/Disconnect',
request_serializer=python__panel__service__pb2.DisconnectRequest.SerializeToString,
response_deserializer=python__panel__service__pb2.DisconnectResponse.FromString,
)
self.GetValue = channel.unary_unary(
'/ni.pythonpanel.v1.PythonPanelService/GetValue',
request_serializer=python__panel__service__pb2.GetValueRequest.SerializeToString,
response_deserializer=python__panel__service__pb2.GetValueResponse.FromString,
)
self.SetValue = channel.unary_unary(
'/ni.pythonpanel.v1.PythonPanelService/SetValue',
request_serializer=python__panel__service__pb2.SetValueRequest.SerializeToString,
response_deserializer=python__panel__service__pb2.SetValueResponse.FromString,
)


class PythonPanelServiceServicer(object):
"""Service interface for connecting to python panels
"""

def Connect(self, request, context):
"""Connect to a panel and open it
Status Codes for errors:
- NOT_FOUND: the file for the panel was not found
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def Disconnect(self, request, context):
"""Disconnect from a panel (does not close the panel)
Status Codes for errors:
- NOT_FOUND: the panel with the specified id was not found
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def GetValue(self, request, context):
"""Get a value for a control on the panel
Status Codes for errors:
- NOT_FOUND: the panel with the specified id was not found
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def SetValue(self, request, context):
"""Set a value for a control on the panel
Status Codes for errors:
- NOT_FOUND: the panel with the specified id was not found
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')


def add_PythonPanelServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
'Connect': grpc.unary_unary_rpc_method_handler(
servicer.Connect,
request_deserializer=python__panel__service__pb2.ConnectRequest.FromString,
response_serializer=python__panel__service__pb2.ConnectResponse.SerializeToString,
),
'Disconnect': grpc.unary_unary_rpc_method_handler(
servicer.Disconnect,
request_deserializer=python__panel__service__pb2.DisconnectRequest.FromString,
response_serializer=python__panel__service__pb2.DisconnectResponse.SerializeToString,
),
'GetValue': grpc.unary_unary_rpc_method_handler(
servicer.GetValue,
request_deserializer=python__panel__service__pb2.GetValueRequest.FromString,
response_serializer=python__panel__service__pb2.GetValueResponse.SerializeToString,
),
'SetValue': grpc.unary_unary_rpc_method_handler(
servicer.SetValue,
request_deserializer=python__panel__service__pb2.SetValueRequest.FromString,
response_serializer=python__panel__service__pb2.SetValueResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'ni.pythonpanel.v1.PythonPanelService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))


# This class is part of an EXPERIMENTAL API.
class PythonPanelService(object):
"""Service interface for connecting to python panels
"""

@staticmethod
def Connect(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/ni.pythonpanel.v1.PythonPanelService/Connect',
python__panel__service__pb2.ConnectRequest.SerializeToString,
python__panel__service__pb2.ConnectResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

@staticmethod
def Disconnect(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/ni.pythonpanel.v1.PythonPanelService/Disconnect',
python__panel__service__pb2.DisconnectRequest.SerializeToString,
python__panel__service__pb2.DisconnectResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

@staticmethod
def GetValue(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/ni.pythonpanel.v1.PythonPanelService/GetValue',
python__panel__service__pb2.GetValueRequest.SerializeToString,
python__panel__service__pb2.GetValueResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

@staticmethod
def SetValue(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/ni.pythonpanel.v1.PythonPanelService/SetValue',
python__panel__service__pb2.SetValueRequest.SerializeToString,
python__panel__service__pb2.SetValueResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
Loading