Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
15 changes: 10 additions & 5 deletions bin/regen-protobufs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@
./nanopb-0.4.7/generator-bin/protoc -I=protobufs --python_out ./ ./protobufs/meshtastic/*.proto

# workaround for import bug in protoc https://github.com/protocolbuffers/protobuf/issues/1491#issuecomment-690618628
mv ./meshtastic/*_pb2.py ./meshtastic/PbDefinitions

if [[ $OSTYPE == 'darwin'* ]]; then
sed -i '' -E 's/^(import.*_pb2)/from . \1/' meshtastic/*.py
sed -i '' -E 's/^(import.*_pb2)/from . \1/' meshtastic/PbDefinitions/*.py
# automate the current workaround (may be related to Meshtastic-protobufs issue #27 https://github.com/meshtastic/protobufs/issues/27)
sed -i '' -E "s/^None = 0/globals()['None'] = 0/" meshtastic/mesh_pb2.py
sed -i '' -E "s/^None = 0/globals()['None'] = 0/" meshtastic/PbDefinitions/mesh_pb2.py
# change from meshtastic to meshtastic.PbDefinitions
sed -i -E 's/^from meshtastic(.*_pb2.*)/from meshtastic.PbDefinitions\1/' meshtastic/PbDefinitions/*.py
else
sed -i -e 's/^import.*_pb2/from . \0/' meshtastic/*.py
sed -i -e 's/^import.*_pb2/from . \0/' meshtastic/PbDefinitions/*.py
# automate the current workaround (may be related to Meshtastic-protobufs issue #27 https://github.com/meshtastic/protobufs/issues/27)
sed -i -e "s/^None = 0/globals()['None'] = 0/" meshtastic/mesh_pb2.py
fi
sed -i -e "s/^None = 0/globals()['None'] = 0/" meshtastic/PbDefinitions/mesh_pb2.py
# change from meshtastic to meshtastic.PbDefinitions
sed -i -E 's/^from meshtastic(.*_pb2.*)/from meshtastic.PbDefinitions\1/' meshtastic/PbDefinitions/*.py
fi
Empty file.
40 changes: 40 additions & 0 deletions meshtastic/PbDefinitions/admin_pb2.py

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

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

40 changes: 40 additions & 0 deletions meshtastic/PbDefinitions/atak_pb2.py

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

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

34 changes: 34 additions & 0 deletions meshtastic/PbDefinitions/channel_pb2.py

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

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

Loading