summaryrefslogtreecommitdiff
path: root/src/home/config
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2022-05-17 10:38:27 +0300
committerEvgeny Zinoviev <me@ch1p.io>2022-05-17 23:50:21 +0300
commit6f965e85a633d3b7f7ab049076fb506c91275bea (patch)
tree5b3b7dff726483d86a74c7db4875f16c8ffb3fad /src/home/config
parentf1b52a92201e7240519a5fe23cf9a52df013a910 (diff)
initial camera support (only esp32-cam at the moment)
Diffstat (limited to 'src/home/config')
-rw-r--r--src/home/config/config.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/home/config/config.py b/src/home/config/config.py
index 75cfc3a..40aa476 100644
--- a/src/home/config/config.py
+++ b/src/home/config/config.py
@@ -37,20 +37,23 @@ class ConfigStore:
log_default_fmt = False
log_file = None
log_verbose = False
+ no_config = name is False
path = None
if use_cli:
if parser is None:
parser = ArgumentParser()
- parser.add_argument('--config', type=str, required=name is None,
- help='Path to the config in TOML format')
- parser.add_argument('--verbose', action='store_true')
+ if not no_config:
+ parser.add_argument('-c', '--config', type=str, required=name is None,
+ help='Path to the config in TOML format')
+ parser.add_argument('-V', '--verbose', action='store_true')
parser.add_argument('--log-file', type=str)
parser.add_argument('--log-default-fmt', action='store_true')
args = parser.parse_args()
- if args.config:
+ if not no_config and args.config:
path = args.config
+
if args.verbose:
log_verbose = True
if args.log_file:
@@ -58,10 +61,10 @@ class ConfigStore:
if args.log_default_fmt:
log_default_fmt = args.log_default_fmt
- if name and path is None:
+ if not no_config and path is None:
path = _get_config_path(name)
- self.data = toml.load(path)
+ self.data = {} if no_config else toml.load(path)
if 'logging' in self:
if not log_file and 'file' in self['logging']: