From 20044762af2ffc37c862b622ef677b49ba66d743 Mon Sep 17 00:00:00 2001 From: tobi-wan-kenobi Date: Wed, 8 Apr 2020 11:50:00 +0200 Subject: [PATCH] [core/config] Ignore malformed parameters --- core/config.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/config.py b/core/config.py index bdfd17c..5e2a177 100644 --- a/core/config.py +++ b/core/config.py @@ -1,8 +1,11 @@ import argparse +import logging import util.store import util.format +log = logging.getLogger(__name__) + MODULE_HELP = 'Specify a space-separated list of modules to load. The order of the list determines their order in the i3bar (from left to right). Use : to provide an alias in case you want to load the same module multiple times, but specify different parameters.' PARAMETER_HELP = 'Provide configuration parameters in the form of .=' THEME_HELP = 'Specify the theme to use for drawing modules' @@ -27,6 +30,9 @@ class Config(util.store.Store): parameters = [ item for sub in self.__args.parameters for item in sub ] for param in parameters: + if not '=' in param: + log.error('missing value for parameter "{}" - ignoring this parameter'.format(param)) + continue key, value = param.split('=', 1) self.set(key, value)