Skip to content

Commit

Permalink
minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
fdev31 committed Sep 29, 2024
1 parent 8399e0c commit 1241f06
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions pyprland/plugins/scratchpads/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ def __init__(
def __setitem__(self, name: str, value: float | bool | str | list) -> None:
self.ref[name] = value

def update(self, other: dict[str, float | bool | str | list]) -> None:
"""Update the configuration with another dictionary."""
self.ref.update(other)

def __getitem__(self, name: str) -> float | bool | str | list:
override = self.mon_override.get(state.active_monitor, {})
if name in override:
Expand Down
5 changes: 3 additions & 2 deletions pyprland/plugins/scratchpads/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,11 @@ def set_config(self, full_config: dict[str, Any]) -> None:
inheritance = orig_config["inherit"]
if isinstance(inheritance, str):
inheritance = [inheritance]

for source in inheritance:
try:
if source in full_config:
opts.update(full_config[source])
except KeyError:
else:
text = f"Scratchpad {self.uid} tried to inherit from {source}, but it doesn't exist"
self.log.exception(text)

Expand Down
2 changes: 1 addition & 1 deletion pyprland/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Package version."""

VERSION = "2.4.0-57"
VERSION = "2.4.0-58"

0 comments on commit 1241f06

Please sign in to comment.