From 907336204b977c9763b018af1953ec40a2150d6d Mon Sep 17 00:00:00 2001 From: Kevin Matz Date: Sun, 3 Nov 2019 20:42:23 -0500 Subject: [PATCH] sanity checks on user configured value --- buttond.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/buttond.py b/buttond.py index 9f19fb5..0a47d3f 100755 --- a/buttond.py +++ b/buttond.py @@ -26,6 +26,12 @@ from signal import pause def activate(path): + if path is None: + return + path = path.strip() + if path is "": + return + print("doing macro ", path) comment(path) @@ -33,7 +39,7 @@ def activate(path): _buttons = {} # open config file -config = configparser.ConfigParser(allow_no_value=False) +config = configparser.ConfigParser(allow_no_value=True) config.read('buttons.cfg') # set up each buttons for b in config.get('button', 'names').split(','):