From ce8bb5f725ae77d78ba0e634bd03963af6194fa3 Mon Sep 17 00:00:00 2001 From: Rodrigo Queiro Date: Thu, 25 Jan 2018 18:52:04 +0100 Subject: [PATCH] Fix shebangs and permissions The scripts have a mix of no shebang, python and python3 (a relatively harmless difference). They are also not all executable, which is worse, as users appear to: - run the script - get permission denied - run the script with sudo - start superstitiously using sudo - break the virtualenv by using sudo cf: https://github.com/google/aiyprojects-raspbian/issues/238#issuecomment-360238630 Change-Id: I5d53b147f806d2318668d147bfd42f757692380d --- src/examples/vision/annotator.py | 2 +- src/examples/vision/dish_classifier.py | 2 +- src/examples/vision/gpiozero/button_example.py | 1 + src/examples/vision/gpiozero/hat_button.py | 1 + src/examples/vision/gpiozero/led_example.py | 1 + src/examples/vision/gpiozero/servo_example.py | 1 + src/examples/vision/gpiozero/simple_button_example.py | 1 + src/examples/vision/image_classification.py | 0 src/examples/vision/leds_example.py | 1 + src/examples/vision/object_detection_camera.py | 2 +- .../vision/object_meter/wordnet_grouping/category_mapper.py | 2 +- .../vision/object_meter/wordnet_grouping/mapping_data.py | 1 - 12 files changed, 10 insertions(+), 5 deletions(-) mode change 100644 => 100755 src/examples/vision/annotator.py mode change 100644 => 100755 src/examples/vision/dish_classifier.py mode change 100644 => 100755 src/examples/vision/gpiozero/button_example.py mode change 100644 => 100755 src/examples/vision/gpiozero/hat_button.py mode change 100644 => 100755 src/examples/vision/gpiozero/led_example.py mode change 100644 => 100755 src/examples/vision/gpiozero/servo_example.py mode change 100644 => 100755 src/examples/vision/gpiozero/simple_button_example.py mode change 100644 => 100755 src/examples/vision/image_classification.py mode change 100644 => 100755 src/examples/vision/leds_example.py mode change 100644 => 100755 src/examples/vision/object_detection_camera.py mode change 100644 => 100755 src/examples/vision/object_meter/wordnet_grouping/category_mapper.py diff --git a/src/examples/vision/annotator.py b/src/examples/vision/annotator.py old mode 100644 new mode 100755 index db53581f..399a9eec --- a/src/examples/vision/annotator.py +++ b/src/examples/vision/annotator.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/examples/vision/dish_classifier.py b/src/examples/vision/dish_classifier.py old mode 100644 new mode 100755 index 8b077309..862b48f0 --- a/src/examples/vision/dish_classifier.py +++ b/src/examples/vision/dish_classifier.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/examples/vision/gpiozero/button_example.py b/src/examples/vision/gpiozero/button_example.py old mode 100644 new mode 100755 index 8af353ed..075c2f8d --- a/src/examples/vision/gpiozero/button_example.py +++ b/src/examples/vision/gpiozero/button_example.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 """Example code that demonstrates using a standard pin along with a hat pin. The button uses a standard GPIO pin through the raspberry pi's memory mapped io, diff --git a/src/examples/vision/gpiozero/hat_button.py b/src/examples/vision/gpiozero/hat_button.py old mode 100644 new mode 100755 index fb47f19e..7915548a --- a/src/examples/vision/gpiozero/hat_button.py +++ b/src/examples/vision/gpiozero/hat_button.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 """Example code that demonstrates using a button connected through the hat. The button uses a hat pin through the sysfs driver illustrating the edge diff --git a/src/examples/vision/gpiozero/led_example.py b/src/examples/vision/gpiozero/led_example.py old mode 100644 new mode 100755 index 9a287afe..c5854d1d --- a/src/examples/vision/gpiozero/led_example.py +++ b/src/examples/vision/gpiozero/led_example.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 """Demonstrates on board LED support with correct polarity. Demo will turn on, then off the first LED on the hat. diff --git a/src/examples/vision/gpiozero/servo_example.py b/src/examples/vision/gpiozero/servo_example.py old mode 100644 new mode 100755 index 7195bcf9..737bd83e --- a/src/examples/vision/gpiozero/servo_example.py +++ b/src/examples/vision/gpiozero/servo_example.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 """Demonstrates simultaneous control of two servos on the hat. One servo uses the simple default configuration, the other servo is tuned to diff --git a/src/examples/vision/gpiozero/simple_button_example.py b/src/examples/vision/gpiozero/simple_button_example.py old mode 100644 new mode 100755 index cca59112..cb5459cb --- a/src/examples/vision/gpiozero/simple_button_example.py +++ b/src/examples/vision/gpiozero/simple_button_example.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 """Example code that demonstrates using a standard pin along with a hat pin. The button uses a standard GPIO pin through the raspberry pi's memory mapped io, diff --git a/src/examples/vision/image_classification.py b/src/examples/vision/image_classification.py old mode 100644 new mode 100755 diff --git a/src/examples/vision/leds_example.py b/src/examples/vision/leds_example.py old mode 100644 new mode 100755 index b32bd7e7..5c92434f --- a/src/examples/vision/leds_example.py +++ b/src/examples/vision/leds_example.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 # Copyright 2018 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/examples/vision/object_detection_camera.py b/src/examples/vision/object_detection_camera.py old mode 100644 new mode 100755 index 17a798a5..c79c57d4 --- a/src/examples/vision/object_detection_camera.py +++ b/src/examples/vision/object_detection_camera.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/examples/vision/object_meter/wordnet_grouping/category_mapper.py b/src/examples/vision/object_meter/wordnet_grouping/category_mapper.py old mode 100644 new mode 100755 index dc9e684d..7fe36509 --- a/src/examples/vision/object_meter/wordnet_grouping/category_mapper.py +++ b/src/examples/vision/object_meter/wordnet_grouping/category_mapper.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright 2018 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/examples/vision/object_meter/wordnet_grouping/mapping_data.py b/src/examples/vision/object_meter/wordnet_grouping/mapping_data.py index 4b07fcb6..da230c23 100644 --- a/src/examples/vision/object_meter/wordnet_grouping/mapping_data.py +++ b/src/examples/vision/object_meter/wordnet_grouping/mapping_data.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # Copyright 2018 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License");