Skip to content

Commit 173ee7f

Browse files
mikeprosserniMike Prosser
andauthored
Update python_panel_service.proto file to remove Disconnect and change Connect to OpenPanel (#15)
* update proto file to remove Disconnect and change Connect to OpenPanel * cleanup --------- Co-authored-by: Mike Prosser <Mike.Prosser@emerson.com>
1 parent e0b567a commit 173ee7f

11 files changed

+88
-260
lines changed

protos/ni/pythonpanel/v1/python_panel_service.proto

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,12 @@ option objc_class_prefix = "NIPP";
1414
option php_namespace = "NI\\PythonPanel\\V1";
1515
option ruby_package = "NI::PythonPanel::V1";
1616

17-
// Service interface for connecting to python panels
17+
// Service interface for interacting with python panels
1818
service PythonPanelService {
19-
// Connect to a panel and open it
19+
// Open a panel
2020
// Status Codes for errors:
2121
// - NOT_FOUND: the file for the panel was not found
22-
rpc Connect(ConnectRequest) returns (ConnectResponse);
23-
24-
// Disconnect from a panel (does not close the panel)
25-
// Status Codes for errors:
26-
// - NOT_FOUND: the panel with the specified id was not found
27-
rpc Disconnect(DisconnectRequest) returns (DisconnectResponse);
22+
rpc OpenPanel(OpenPanelRequest) returns (OpenPanelResponse);
2823

2924
// Get a value for a control on the panel
3025
// Status Codes for errors:
@@ -37,23 +32,15 @@ service PythonPanelService {
3732
rpc SetValue(SetValueRequest) returns (SetValueResponse);
3833
}
3934

40-
message ConnectRequest {
35+
message OpenPanelRequest {
4136
// Unique ID of the panel
4237
string panel_id = 1;
4338

4439
// Absolute path of the panel's file on disk, or network path to the file
4540
string panel_uri = 2;
4641
}
4742

48-
message ConnectResponse {
49-
}
50-
51-
message DisconnectRequest {
52-
// Unique ID of the panel
53-
string panel_id = 1;
54-
}
55-
56-
message DisconnectResponse {
43+
message OpenPanelResponse {
5744
}
5845

5946
message GetValueRequest {

src/ni/pythonpanel/v1/python_panel_service_pb2.py

Lines changed: 15 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ni/pythonpanel/v1/python_panel_service_pb2.pyi

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import typing
1212
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
1313

1414
@typing.final
15-
class ConnectRequest(google.protobuf.message.Message):
15+
class OpenPanelRequest(google.protobuf.message.Message):
1616
DESCRIPTOR: google.protobuf.descriptor.Descriptor
1717

1818
PANEL_ID_FIELD_NUMBER: builtins.int
@@ -29,43 +29,17 @@ class ConnectRequest(google.protobuf.message.Message):
2929
) -> None: ...
3030
def ClearField(self, field_name: typing.Literal["panel_id", b"panel_id", "panel_uri", b"panel_uri"]) -> None: ...
3131

32-
global___ConnectRequest = ConnectRequest
32+
global___OpenPanelRequest = OpenPanelRequest
3333

3434
@typing.final
35-
class ConnectResponse(google.protobuf.message.Message):
35+
class OpenPanelResponse(google.protobuf.message.Message):
3636
DESCRIPTOR: google.protobuf.descriptor.Descriptor
3737

3838
def __init__(
3939
self,
4040
) -> None: ...
4141

42-
global___ConnectResponse = ConnectResponse
43-
44-
@typing.final
45-
class DisconnectRequest(google.protobuf.message.Message):
46-
DESCRIPTOR: google.protobuf.descriptor.Descriptor
47-
48-
PANEL_ID_FIELD_NUMBER: builtins.int
49-
panel_id: builtins.str
50-
"""Unique ID of the panel"""
51-
def __init__(
52-
self,
53-
*,
54-
panel_id: builtins.str = ...,
55-
) -> None: ...
56-
def ClearField(self, field_name: typing.Literal["panel_id", b"panel_id"]) -> None: ...
57-
58-
global___DisconnectRequest = DisconnectRequest
59-
60-
@typing.final
61-
class DisconnectResponse(google.protobuf.message.Message):
62-
DESCRIPTOR: google.protobuf.descriptor.Descriptor
63-
64-
def __init__(
65-
self,
66-
) -> None: ...
67-
68-
global___DisconnectResponse = DisconnectResponse
42+
global___OpenPanelResponse = OpenPanelResponse
6943

7044
@typing.final
7145
class GetValueRequest(google.protobuf.message.Message):

src/ni/pythonpanel/v1/python_panel_service_pb2_grpc.py

Lines changed: 17 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
class PythonPanelServiceStub(object):
9-
"""Service interface for connecting to python panels
9+
"""Service interface for interacting with python panels
1010
"""
1111

1212
def __init__(self, channel):
@@ -15,15 +15,10 @@ def __init__(self, channel):
1515
Args:
1616
channel: A grpc.Channel.
1717
"""
18-
self.Connect = channel.unary_unary(
19-
'/ni.pythonpanel.v1.PythonPanelService/Connect',
20-
request_serializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.ConnectRequest.SerializeToString,
21-
response_deserializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.ConnectResponse.FromString,
22-
)
23-
self.Disconnect = channel.unary_unary(
24-
'/ni.pythonpanel.v1.PythonPanelService/Disconnect',
25-
request_serializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.DisconnectRequest.SerializeToString,
26-
response_deserializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.DisconnectResponse.FromString,
18+
self.OpenPanel = channel.unary_unary(
19+
'/ni.pythonpanel.v1.PythonPanelService/OpenPanel',
20+
request_serializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.OpenPanelRequest.SerializeToString,
21+
response_deserializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.OpenPanelResponse.FromString,
2722
)
2823
self.GetValue = channel.unary_unary(
2924
'/ni.pythonpanel.v1.PythonPanelService/GetValue',
@@ -38,27 +33,18 @@ def __init__(self, channel):
3833

3934

4035
class PythonPanelServiceServicer(object):
41-
"""Service interface for connecting to python panels
36+
"""Service interface for interacting with python panels
4237
"""
4338

44-
def Connect(self, request, context):
45-
"""Connect to a panel and open it
39+
def OpenPanel(self, request, context):
40+
"""Open a panel
4641
Status Codes for errors:
4742
- NOT_FOUND: the file for the panel was not found
4843
"""
4944
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
5045
context.set_details('Method not implemented!')
5146
raise NotImplementedError('Method not implemented!')
5247

53-
def Disconnect(self, request, context):
54-
"""Disconnect from a panel (does not close the panel)
55-
Status Codes for errors:
56-
- NOT_FOUND: the panel with the specified id was not found
57-
"""
58-
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
59-
context.set_details('Method not implemented!')
60-
raise NotImplementedError('Method not implemented!')
61-
6248
def GetValue(self, request, context):
6349
"""Get a value for a control on the panel
6450
Status Codes for errors:
@@ -80,15 +66,10 @@ def SetValue(self, request, context):
8066

8167
def add_PythonPanelServiceServicer_to_server(servicer, server):
8268
rpc_method_handlers = {
83-
'Connect': grpc.unary_unary_rpc_method_handler(
84-
servicer.Connect,
85-
request_deserializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.ConnectRequest.FromString,
86-
response_serializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.ConnectResponse.SerializeToString,
87-
),
88-
'Disconnect': grpc.unary_unary_rpc_method_handler(
89-
servicer.Disconnect,
90-
request_deserializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.DisconnectRequest.FromString,
91-
response_serializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.DisconnectResponse.SerializeToString,
69+
'OpenPanel': grpc.unary_unary_rpc_method_handler(
70+
servicer.OpenPanel,
71+
request_deserializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.OpenPanelRequest.FromString,
72+
response_serializer=ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.OpenPanelResponse.SerializeToString,
9273
),
9374
'GetValue': grpc.unary_unary_rpc_method_handler(
9475
servicer.GetValue,
@@ -108,28 +89,11 @@ def add_PythonPanelServiceServicer_to_server(servicer, server):
10889

10990
# This class is part of an EXPERIMENTAL API.
11091
class PythonPanelService(object):
111-
"""Service interface for connecting to python panels
92+
"""Service interface for interacting with python panels
11293
"""
11394

11495
@staticmethod
115-
def Connect(request,
116-
target,
117-
options=(),
118-
channel_credentials=None,
119-
call_credentials=None,
120-
insecure=False,
121-
compression=None,
122-
wait_for_ready=None,
123-
timeout=None,
124-
metadata=None):
125-
return grpc.experimental.unary_unary(request, target, '/ni.pythonpanel.v1.PythonPanelService/Connect',
126-
ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.ConnectRequest.SerializeToString,
127-
ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.ConnectResponse.FromString,
128-
options, channel_credentials,
129-
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
130-
131-
@staticmethod
132-
def Disconnect(request,
96+
def OpenPanel(request,
13397
target,
13498
options=(),
13599
channel_credentials=None,
@@ -139,9 +103,9 @@ def Disconnect(request,
139103
wait_for_ready=None,
140104
timeout=None,
141105
metadata=None):
142-
return grpc.experimental.unary_unary(request, target, '/ni.pythonpanel.v1.PythonPanelService/Disconnect',
143-
ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.DisconnectRequest.SerializeToString,
144-
ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.DisconnectResponse.FromString,
106+
return grpc.experimental.unary_unary(request, target, '/ni.pythonpanel.v1.PythonPanelService/OpenPanel',
107+
ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.OpenPanelRequest.SerializeToString,
108+
ni_dot_pythonpanel_dot_v1_dot_python__panel__service__pb2.OpenPanelResponse.FromString,
145109
options, channel_credentials,
146110
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
147111

src/ni/pythonpanel/v1/python_panel_service_pb2_grpc.pyi

Lines changed: 15 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,18 @@ class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type:
1818
...
1919

2020
class PythonPanelServiceStub:
21-
"""Service interface for connecting to python panels"""
21+
"""Service interface for interacting with python panels"""
2222

2323
def __init__(self, channel: typing.Union[grpc.Channel, grpc.aio.Channel]) -> None: ...
24-
Connect: grpc.UnaryUnaryMultiCallable[
25-
ni.pythonpanel.v1.python_panel_service_pb2.ConnectRequest,
26-
ni.pythonpanel.v1.python_panel_service_pb2.ConnectResponse,
24+
OpenPanel: grpc.UnaryUnaryMultiCallable[
25+
ni.pythonpanel.v1.python_panel_service_pb2.OpenPanelRequest,
26+
ni.pythonpanel.v1.python_panel_service_pb2.OpenPanelResponse,
2727
]
28-
"""Connect to a panel and open it
28+
"""Open a panel
2929
Status Codes for errors:
3030
- NOT_FOUND: the file for the panel was not found
3131
"""
3232

33-
Disconnect: grpc.UnaryUnaryMultiCallable[
34-
ni.pythonpanel.v1.python_panel_service_pb2.DisconnectRequest,
35-
ni.pythonpanel.v1.python_panel_service_pb2.DisconnectResponse,
36-
]
37-
"""Disconnect from a panel (does not close the panel)
38-
Status Codes for errors:
39-
- NOT_FOUND: the panel with the specified id was not found
40-
"""
41-
4233
GetValue: grpc.UnaryUnaryMultiCallable[
4334
ni.pythonpanel.v1.python_panel_service_pb2.GetValueRequest,
4435
ni.pythonpanel.v1.python_panel_service_pb2.GetValueResponse,
@@ -58,26 +49,17 @@ class PythonPanelServiceStub:
5849
"""
5950

6051
class PythonPanelServiceAsyncStub:
61-
"""Service interface for connecting to python panels"""
52+
"""Service interface for interacting with python panels"""
6253

63-
Connect: grpc.aio.UnaryUnaryMultiCallable[
64-
ni.pythonpanel.v1.python_panel_service_pb2.ConnectRequest,
65-
ni.pythonpanel.v1.python_panel_service_pb2.ConnectResponse,
54+
OpenPanel: grpc.aio.UnaryUnaryMultiCallable[
55+
ni.pythonpanel.v1.python_panel_service_pb2.OpenPanelRequest,
56+
ni.pythonpanel.v1.python_panel_service_pb2.OpenPanelResponse,
6657
]
67-
"""Connect to a panel and open it
58+
"""Open a panel
6859
Status Codes for errors:
6960
- NOT_FOUND: the file for the panel was not found
7061
"""
7162

72-
Disconnect: grpc.aio.UnaryUnaryMultiCallable[
73-
ni.pythonpanel.v1.python_panel_service_pb2.DisconnectRequest,
74-
ni.pythonpanel.v1.python_panel_service_pb2.DisconnectResponse,
75-
]
76-
"""Disconnect from a panel (does not close the panel)
77-
Status Codes for errors:
78-
- NOT_FOUND: the panel with the specified id was not found
79-
"""
80-
8163
GetValue: grpc.aio.UnaryUnaryMultiCallable[
8264
ni.pythonpanel.v1.python_panel_service_pb2.GetValueRequest,
8365
ni.pythonpanel.v1.python_panel_service_pb2.GetValueResponse,
@@ -97,30 +79,19 @@ class PythonPanelServiceAsyncStub:
9779
"""
9880

9981
class PythonPanelServiceServicer(metaclass=abc.ABCMeta):
100-
"""Service interface for connecting to python panels"""
82+
"""Service interface for interacting with python panels"""
10183

10284
@abc.abstractmethod
103-
def Connect(
85+
def OpenPanel(
10486
self,
105-
request: ni.pythonpanel.v1.python_panel_service_pb2.ConnectRequest,
87+
request: ni.pythonpanel.v1.python_panel_service_pb2.OpenPanelRequest,
10688
context: _ServicerContext,
107-
) -> typing.Union[ni.pythonpanel.v1.python_panel_service_pb2.ConnectResponse, collections.abc.Awaitable[ni.pythonpanel.v1.python_panel_service_pb2.ConnectResponse]]:
108-
"""Connect to a panel and open it
89+
) -> typing.Union[ni.pythonpanel.v1.python_panel_service_pb2.OpenPanelResponse, collections.abc.Awaitable[ni.pythonpanel.v1.python_panel_service_pb2.OpenPanelResponse]]:
90+
"""Open a panel
10991
Status Codes for errors:
11092
- NOT_FOUND: the file for the panel was not found
11193
"""
11294

113-
@abc.abstractmethod
114-
def Disconnect(
115-
self,
116-
request: ni.pythonpanel.v1.python_panel_service_pb2.DisconnectRequest,
117-
context: _ServicerContext,
118-
) -> typing.Union[ni.pythonpanel.v1.python_panel_service_pb2.DisconnectResponse, collections.abc.Awaitable[ni.pythonpanel.v1.python_panel_service_pb2.DisconnectResponse]]:
119-
"""Disconnect from a panel (does not close the panel)
120-
Status Codes for errors:
121-
- NOT_FOUND: the panel with the specified id was not found
122-
"""
123-
12495
@abc.abstractmethod
12596
def GetValue(
12697
self,

0 commit comments

Comments
 (0)