Skip to content

Commit 209a6c8

Browse files
Update __init__.py to allow for finding classes that start with a valid name
1 parent 46fa19e commit 209a6c8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

qwiic/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ def _load_driver_classes():
161161
try:
162162
driver_packages = os.listdir(driver_dir)
163163
driver_packages += os.listdir(driver_dir_linux)
164+
if "qwiic_i2c" in driver_packages:
165+
driver_packages.remove("qwiic_i2c")
164166
except IOError:
165167
print("The qwiic drivers are not installed - please check your installation")
166168
return
@@ -186,6 +188,8 @@ def _load_driver_classes():
186188
for tmp in moduleItems:
187189
if lname == tmp.lower():
188190
break
191+
elif tmp.lower().startswith(lname):
192+
break
189193
i = i + 1
190194

191195
if i >= len(moduleItems):

0 commit comments

Comments
 (0)