-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Python SDK Refactor and Tutorial Updates
* Rearchitect Python SDK to encapsulate all operations in Message objects * Share Protobuf building architecture between Python SDK and Tutorials * Add missing functionality from last 2 Hero 12 releases * Implement PUT support and add custom preset update operation * Add in new setting options * Refactor Tutorials to allow for non-TLV packets * Add Protobuf Tutorials * Add WiFi Station Mode Tutorial * Add COHN Tutotrial
- Loading branch information
github-actions
committed
Apr 9, 2024
1 parent
56aed48
commit 69924b4
Showing
201 changed files
with
14,593 additions
and
8,135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
** | ||
|
||
!entrypoint.sh | ||
!requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Dockerfile/Open GoPro, Version 2.0 (C) Copyright 2021 GoPro, Inc. (http://gopro.com/OpenGoPro). | ||
# This copyright was auto-generated on Wed Mar 27 22:05:54 UTC 2024 | ||
|
||
FROM python:3.11-bookworm | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
protobuf-compiler \ | ||
bash | ||
|
||
COPY . /workdir | ||
RUN pip install -r /workdir/requirements.txt | ||
|
||
RUN chmod +x /workdir/entrypoint.sh | ||
|
||
ENTRYPOINT [ "/workdir/entrypoint.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Protobuf Builder | ||
|
||
This is a Docker image to build the [Protobuf](../../protobuf/) files in this repo. It currently only build Python | ||
output but should be used in the future for other languages. | ||
|
||
## Usage | ||
|
||
It is intended to be used via the [docker compose configuration](../../docker-compose.yml). | ||
|
||
First build: | ||
|
||
```shell | ||
docker compose build proto-build | ||
``` | ||
|
||
Then build the protobuf files with: | ||
|
||
```shell | ||
docker compose run --rm proto-build | ||
``` | ||
|
||
The output files will be placed in the [build directory](../../.build/protobuf). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env bash | ||
# entrypoint.sh/Open GoPro, Version 2.0 (C) Copyright 2021 GoPro, Inc. (http://gopro.com/OpenGoPro). | ||
# This copyright was auto-generated on Wed Mar 27 22:05:54 UTC 2024 | ||
|
||
|
||
PROTO_SRC_DIR=/proto_in | ||
PROTO_PYTHON_OUT_DIR=/proto_python_out | ||
|
||
rm -rf $PROTO_PYTHON_OUT_DIR && mkdir -p $PROTO_PYTHON_OUT_DIR | ||
|
||
echo | ||
echo "Building protobuf python files and stubs from .proto source files..." | ||
pushd $PROTO_SRC_DIR | ||
protoc --include_imports --descriptor_set_out=$PROTO_PYTHON_OUT_DIR/descriptors --python_out=$PROTO_PYTHON_OUT_DIR --mypy_out=$PROTO_PYTHON_OUT_DIR * | ||
popd | ||
|
||
pushd $PROTO_PYTHON_OUT_DIR | ||
echo | ||
echo "Converting relative imports to absolute..." | ||
protol -o . --in-place raw descriptors | ||
rm descriptors | ||
|
||
# Format generated files | ||
echo | ||
echo "Formatting..." | ||
black . | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
mypy-protobuf==3.5.0 | ||
protoletariat==3.2.19 | ||
black |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
**/*.crt | ||
/.build | ||
|
||
/.env | ||
**.log | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/.idea/ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.