Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nanopb/nanopb.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2020-06-18 13:36:09 +0300
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2020-06-18 13:39:30 +0300
commitbf1eb547d76d416c83ec3c3ca2d8f8f6fdc2770b (patch)
treef994b75d8ec77595ec5107b0818356571752d0d9 /generator/protoc-gen-nanopb-py2
parent040cd30712a4e8a62c0b36a39e776e18e93d0052 (diff)
Change generator to use Python 3 by default (#441, #509).
This may break things for users that have python-protobuf installed only for Python 2. Easiest fix is to just install python3-protobuf. After much consideration, I think making the change now will make life easiest for most users. There are now alternative files that can be used if only Python 2 is available, see migration.rst.
Diffstat (limited to 'generator/protoc-gen-nanopb-py2')
-rwxr-xr-xgenerator/protoc-gen-nanopb-py216
1 files changed, 16 insertions, 0 deletions
diff --git a/generator/protoc-gen-nanopb-py2 b/generator/protoc-gen-nanopb-py2
new file mode 100755
index 0000000..e642709
--- /dev/null
+++ b/generator/protoc-gen-nanopb-py2
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+# This file is used to invoke nanopb_generator.py2 as a plugin
+# to protoc on Linux and other *nix-style systems.
+#
+# The difference from protoc-gen-nanopb is that this executes with Python 2.
+#
+# Use it like this:
+# protoc --plugin=protoc-gen-nanopb=..../protoc-gen-nanopb-py2 --nanopb_out=dir foo.proto
+#
+# Note that if you use the binary package of nanopb, the protoc
+# path is already set up properly and there is no need to give
+# --plugin= on the command line.
+
+MYPATH=$(dirname "$0")
+exec "$MYPATH/nanopb_generator.py2" --protoc-plugin