From c5715a93a58d00ba3a77458e90d47d4e6e4e7878 Mon Sep 17 00:00:00 2001 From: Andrew Udvare Date: Wed, 11 Oct 2023 18:23:44 -0400 Subject: [PATCH] Better name for kwarg --- macprefs/command.py | 2 +- macprefs/plist2defaults.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/macprefs/command.py b/macprefs/command.py index 72b5b95..298293e 100644 --- a/macprefs/command.py +++ b/macprefs/command.py @@ -107,7 +107,7 @@ async def _do_main(out_dir: Path, commit: bool = False, deploy_key: str | None = for line in plist_to_defaults_commands(domain, root, domain_filter=None, - reverse_filters=True): + inverse_filters=True): f.write(f'{line}\n') assert len(known_domains) > 0 results = (await asyncio.wait(tasks))[0] diff --git a/macprefs/plist2defaults.py b/macprefs/plist2defaults.py index 8efeb63..e558f03 100644 --- a/macprefs/plist2defaults.py +++ b/macprefs/plist2defaults.py @@ -51,15 +51,15 @@ def plist_to_defaults_commands(domain: str, root: PlistRoot, domain_filter: Callable[[str], bool] | None = should_ignore_domain, key_filter: Callable[[str, str], bool] | None = should_ignore_key, - reverse_filters: bool = False) -> Iterator[str]: + inverse_filters: bool = False) -> Iterator[str]: """Given a ``PlistRoot``, generate a series of ``defaults write`` commands.""" - if domain_filter and (not domain_filter(domain) if reverse_filters else domain_filter(domain)): + if domain_filter and (not domain_filter(domain) if inverse_filters else domain_filter(domain)): return values: list[str] = [] prefix = f'defaults write {quote(domain)}' for key, value in sorted(root.items()): if (key_filter - and (not key_filter(domain, key) if reverse_filters else key_filter(domain, key))): + and (not key_filter(domain, key) if inverse_filters else key_filter(domain, key))): continue values.extend(convert_value(key, value, prefix)) if values: