Skip to content

Commit

Permalink
Final tweaks (#21)
Browse files Browse the repository at this point in the history
* fix conf loading and tweak dict merge

* bump version
  • Loading branch information
Korijn authored Aug 1, 2023
1 parent 19f1cf4 commit f6342f8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion keycmd/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.5.0"
__version__ = "0.6.0"
5 changes: 4 additions & 1 deletion keycmd/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def merge_conf(a, b):
a = a.copy()
for key, value in b.items():
if isinstance(value, dict):
old_value = a.setdefault(key, {})
old_value = a.get(key, {})
a[key] = merge_conf(old_value, value)
else:
a[key] = value
Expand All @@ -94,6 +94,9 @@ def load_conf():
# .keycmd
local_keycmds = find_file(".keycmd", first_only=False)
for local_keycmd in local_keycmds:
if local_keycmd == user_keyconf:
vlog(f"skipping config file {local_keycmd} (already loaded)")
continue
vlog(f"loading config file {local_keycmd}")
conf = merge_conf(conf, load_toml(local_keycmd))

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "keycmd"
version = "0.5.0"
version = "0.6.0"
description = ""
authors = ["Korijn van Golen <korijn.vangolen@zimmerbiomet.com>"]
license = "MIT"
Expand Down

0 comments on commit f6342f8

Please sign in to comment.