Macropad Hotkeys: trap import errors, add comments to config files
This commit is contained in:
parent
80cd34a63b
commit
849dde8619
4 changed files with 12 additions and 3 deletions
|
|
@ -6,7 +6,7 @@ use dial to select an application macro set, press MACROPAD keys to send
|
|||
key sequences.
|
||||
"""
|
||||
|
||||
# pylint: disable=import-error, unused-import, too-few-public-methods
|
||||
# pylint: disable=import-error, unused-import, too-few-public-methods, bare-except
|
||||
|
||||
import os
|
||||
import board
|
||||
|
|
@ -88,8 +88,11 @@ FILES = os.listdir(MACRO_FOLDER)
|
|||
FILES.sort()
|
||||
for FILENAME in FILES:
|
||||
if FILENAME.endswith('.py'):
|
||||
module = __import__(MACRO_FOLDER + '/' + FILENAME[:-3])
|
||||
APPS.append(App(module.app))
|
||||
try:
|
||||
module = __import__(MACRO_FOLDER + '/' + FILENAME[:-3])
|
||||
APPS.append(App(module.app))
|
||||
except:
|
||||
pass
|
||||
|
||||
if not APPS:
|
||||
GROUP[13].text = 'NO MACRO FILES FOUND'
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# MACROPAD Hotkeys example: Adobe Illustrator for Mac
|
||||
|
||||
from adafruit_hid.keycode import Keycode # REQUIRED if using Keycode.* values
|
||||
|
||||
app = { # REQUIRED dict, must be named 'app'
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# MACROPAD Hotkeys example: Adobe Photoshop for Mac
|
||||
|
||||
from adafruit_hid.keycode import Keycode # REQUIRED if using Keycode.* values
|
||||
|
||||
app = { # REQUIRED dict, must be named 'app'
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# MACROPAD Hotkeys example: Safari web browser for Mac
|
||||
|
||||
from adafruit_hid.keycode import Keycode # REQUIRED if using Keycode.* values
|
||||
|
||||
app = { # REQUIRED dict, must be named 'app'
|
||||
|
|
|
|||
Loading…
Reference in a new issue