Skip to content

Commit

Permalink
Better name for kwarg
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Udvare committed Oct 11, 2023
1 parent 071e6e5 commit c5715a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion macprefs/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
6 changes: 3 additions & 3 deletions macprefs/plist2defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit c5715a9

Please sign in to comment.