adafruit / Adafruit_Learning_System_Guides

Programs and scripts to display "inline" in Adafruit Learning System guides

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Circuit Python projects that use adafruit_lsm6ds need their import statements updated for the new version of that library

FoamyGuy opened this issue · comments

adafruit_lsm6ds library was recently split into a module with multiple files and as a result it's usages need to have their import statements updated in order to work with the new version.

I used this script to find projects in this repo that use adafruit_lsm6ds

import os
for file in os.listdir("."):
    #print(file)
    try:
        for sub_file in os.listdir(file):
            #print(f"\t{sub_file}")
            if sub_file.endswith(".py"):
                script_file = open(f"{file}/{sub_file}", "r")
                script_text = script_file.read()
                script_file.close()

                if "adafruit_lsm6ds" in script_text:
                    print(f"{file}/{sub_file} uses adafruit_lsm6ds")
    except NotADirectoryError:
        pass

Here are the projects that it found:

Adafruit_Feather_Sense/feather_sense_sensor_demo.py uses adafruit_lsm6ds
BLE_Sensornet/feather_sense_sensornet.py uses adafruit_lsm6ds
CircuitPython_LED_Sand_Hourglass/double_matrix.py uses adafruit_lsm6ds
CircuitPython_LED_Sand_Hourglass/hourglass.py uses adafruit_lsm6ds
CircuitPython_LED_Sand_Hourglass/single_matrix.py uses adafruit_lsm6ds
CLUE_Egg_Drop/clue_egg_drop.py uses adafruit_lsm6ds
Clue_Step_Counter/clue_step_counter.py uses adafruit_lsm6ds
LED_Bullwhip/code.py uses adafruit_lsm6ds
PowerGlove_BLE_MIDI/powerglove_ble_midi.py uses adafruit_lsm6ds
Raspberry_Pi_9DoF_Sensor_Calibration/9dof_calibration.py uses adafruit_lsm6ds
Ukulele/code.py uses adafruit_lsm6ds

Many or all of these have individual PRs already that I overlooked when this was created.