Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Default code owner for nipanel-python
mikeprosserni
11 changes: 11 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### What does this Pull Request accomplish?

TODO: Include high-level description of the changes in this pull request.

### Why should this Pull Request be merged?

TODO: Justify why this contribution should be part of the project.

### What testing has been done?

TODO: Detail what testing has been done to ensure this submission meets requirements.
62 changes: 62 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Contributing to nipanel-python

Contributions to nipanel-python are welcome from all!

nipanel-python is managed via [git](https://git-scm.com), with the canonical upstream
repository hosted on [GitHub](https://github.com/ni/<reponame>/).

nipanel-python follows a pull-request model for development. If you wish to
contribute, you will need to create a GitHub account, fork this project, push a
branch with your changes to your project, and then submit a pull request.

Please remember to sign off your commits (e.g., by using `git commit -s` if you
are using the command line client). This amends your git commit message with a line
of the form `Signed-off-by: Name Lastname <[email protected]>`. Please
include all authors of any given commit into the commit message with a
`Signed-off-by` line. This indicates that you have read and signed the Developer
Certificate of Origin (see below) and are able to legally submit your code to
this repository.

See [GitHub's official documentation](https://help.github.com/articles/using-pull-requests/) for more details.

# Getting Started

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`

# Testing

- TODO: include testing steps here.

# Developer Certificate of Origin (DCO)

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.

(taken from [developercertificate.org](https://developercertificate.org/))

See [LICENSE](https://github.com/ni/<reponame>/blob/main/LICENSE)
for details about how \<reponame\> is licensed.
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) 2025, National Instruments Corp.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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`
19 changes: 19 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!-- Begin NI SECURITY.md V1.0 -->

# Security

NI views the security of our software products as an important part of our commitment to our users. This includes source code repositories managed through the [NI](https://github.com/ni) GitHub organization.

## Reporting Security Issues

We encourage you to report security vulnerabilities to us privately so we can follow the principle of [Coordinated Vulnerability Disclosure (CVD)](https://vuls.cert.org/confluence/display/CVD). This allows us time to thoroughly investigate security issues and publicly disclose them when appropriate.

**Please do not report security vulnerabilities through public GitHub issues.**

Instead, please report them by sending an email to [[email protected]](mailto:[email protected]) with sufficient details about the type of issue, the impact of the issue, and how to reproduce the issue. You may use the [NI PGP key](https://www.ni.com/en/support/security/pgp.html) to encrypt any sensitive communications you send to us. When you notify us of a potential security issue, our remediation process includes acknowledging receipt and coordinating any necessary response activities with you.

## Learn More

To learn more about NI Security, please see [https://ni.com/security](https://ni.com/security)

<!-- End NI SECURITY.md -->
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