From b437cd0823b0b6d6023511e5244034110def1f5b Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Thu, 2 Aug 2018 20:01:07 -0400 Subject: [PATCH 1/2] updated travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 330653e..0f7435a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ python: cache: pip: true deploy: - provider: releases +- provider: releases api_key: "$GITHUB_TOKEN" file_glob: true file: "$TRAVIS_BUILD_DIR/bundles/*" From 715522403101ed572da2ad36dfbffdf4aa371b36 Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Fri, 3 Aug 2018 13:34:11 -0400 Subject: [PATCH 2/2] linting --- examples/adc.py | 2 +- examples/lis3dh_simpletest.py | 3 ++- examples/spinner.py | 5 +++-- examples/spinner_advanced.py | 6 ++++-- examples/tap.py | 3 ++- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/examples/adc.py b/examples/adc.py index 1197231..1011766 100644 --- a/examples/adc.py +++ b/examples/adc.py @@ -5,13 +5,13 @@ # Author: Tony DiCola import time import board +import busio import adafruit_lis3dh # Uncomment _one_ of the hardware setups below depending on your wiring: # Hardware I2C setup: -import busio i2c = busio.I2C(board.SCL, board.SDA) lis3dh = adafruit_lis3dh.LIS3DH_I2C(i2c) diff --git a/examples/lis3dh_simpletest.py b/examples/lis3dh_simpletest.py index 88467d1..6bd36ef 100644 --- a/examples/lis3dh_simpletest.py +++ b/examples/lis3dh_simpletest.py @@ -4,6 +4,7 @@ # Author: Tony DiCola import time import board +import busio import adafruit_lis3dh @@ -11,7 +12,7 @@ # Hardware I2C setup. Use the CircuitPlayground built-in accelerometer if available; # otherwise check I2C pins. -import busio +# pylint: disable=no-member if hasattr(board, 'ACCELEROMETER_SCL'): i2c = busio.I2C(board.ACCELEROMETER_SCL, board.ACCELEROMETER_SDA) lis3dh = adafruit_lis3dh.LIS3DH_I2C(i2c, address=0x19) diff --git a/examples/spinner.py b/examples/spinner.py index 75dd240..9dad7f8 100644 --- a/examples/spinner.py +++ b/examples/spinner.py @@ -13,11 +13,11 @@ import board import busio +from micropython import const + import adafruit_lis3dh import neopixel -from micropython import const - # Configuration: ACCEL_RANGE = adafruit_lis3dh.RANGE_16_G # Accelerometer range. TAP_THRESHOLD = 20 # Accelerometer tap threshold. Higher values @@ -55,6 +55,7 @@ def get_position(self, delta): return self._position +# pylint: disable=no-member # Initialize NeoPixels and accelerometer. pixels = neopixel.NeoPixel(board.NEOPIXEL, 10, auto_write=False) pixels.fill((0, 0, 0)) diff --git a/examples/spinner_advanced.py b/examples/spinner_advanced.py index 95bc0f7..2c098eb 100644 --- a/examples/spinner_advanced.py +++ b/examples/spinner_advanced.py @@ -20,11 +20,11 @@ import busio import digitalio +from micropython import const + import adafruit_lis3dh import neopixel -from micropython import const - # Configuration: ACCEL_RANGE = adafruit_lis3dh.RANGE_16_G # Accelerometer range. TAP_THRESHOLD = 20 # Accelerometer tap threshold. Higher values @@ -134,6 +134,7 @@ def update(self, position, primary, secondary): self._pixels[pos] = primary self._pixels.show() + class SmoothAnimation: def __init__(self, pixels, frequency=2.0): @@ -162,6 +163,7 @@ def update(self, position, primary, secondary): self._pixels.show() +# pylint: disable=no-member # Initialize and turn off NeoPixels. pixels = neopixel.NeoPixel(board.NEOPIXEL, 10, auto_write=False) pixels.fill((0, 0, 0)) diff --git a/examples/tap.py b/examples/tap.py index e9d6335..2ee96f3 100644 --- a/examples/tap.py +++ b/examples/tap.py @@ -3,15 +3,16 @@ # Open the serial port after running to see the output printed. # Author: Tony DiCola import board -import adafruit_lis3dh import busio import digitalio +import adafruit_lis3dh # Uncomment _one_ of the hardware setups below depending on your wiring: # Hardware I2C setup. Use the CircuitPlayground built-in accelerometer if available; # otherwise check I2C pins. +# pylint: disable=no-member if hasattr(board, 'ACCELEROMETER_SCL'): i2c = busio.I2C(board.ACCELEROMETER_SCL, board.ACCELEROMETER_SDA) int1 = digitalio.DigitalInOut(board.ACCELEROMETER_INTERRUPT)