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:
Diffstat (limited to 'generator/nanopb_generator.py2')
-rwxr-xr-xgenerator/nanopb_generator.py213
1 files changed, 13 insertions, 0 deletions
diff --git a/generator/nanopb_generator.py2 b/generator/nanopb_generator.py2
new file mode 100755
index 0000000..0469461
--- /dev/null
+++ b/generator/nanopb_generator.py2
@@ -0,0 +1,13 @@
+#!/usr/bin/env python2
+# This file is a wrapper around nanopb_generator.py in case you want to run
+# it with Python 2 instead of default Python 3. This only exists for backwards
+# compatibility, do not use for new projects.
+
+from nanopb_generator import *
+
+if __name__ == '__main__':
+ # Check if we are running as a plugin under protoc
+ if 'protoc-gen-' in sys.argv[0] or '--protoc-plugin' in sys.argv:
+ main_plugin()
+ else:
+ main_cli()