more comments
This commit is contained in:
parent
7956b73e2f
commit
4c7192fd41
|
@ -25,12 +25,14 @@ from signal import pause
|
||||||
# Device.pin_factory = MockFactory()
|
# Device.pin_factory = MockFactory()
|
||||||
|
|
||||||
|
|
||||||
|
# callback intermidiary to sanitize user input
|
||||||
def _activate(macro):
|
def _activate(macro):
|
||||||
if macro is None:
|
if macro is None:
|
||||||
return
|
return
|
||||||
macro = macro.strip('\"').upper()
|
macro = macro.strip('\"').upper()
|
||||||
if macro is "":
|
if macro is "":
|
||||||
return
|
return
|
||||||
|
# pass macro to baconscript
|
||||||
print("doing macro ", macro)
|
print("doing macro ", macro)
|
||||||
comment(macro)
|
comment(macro)
|
||||||
|
|
||||||
|
@ -63,12 +65,15 @@ for b in config.get('button', 'names').split(','):
|
||||||
print('Error configuring button', b, e)
|
print('Error configuring button', b, e)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
||||||
|
# clear temp variables off the stack
|
||||||
try:
|
try:
|
||||||
# clear temp variables off the stack
|
|
||||||
del pin, closed, opened
|
del pin, closed, opened
|
||||||
except (NameError):
|
except (NameError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
# when run directly, sleep until button signal or KeyboardInterrupt
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
try:
|
try:
|
||||||
pause()
|
pause()
|
||||||
|
|
Loading…
Reference in New Issue