Skip to content

Commit

Permalink
docs: document ctx.activate() and ctx.override()
Browse files Browse the repository at this point in the history
  • Loading branch information
vberlier committed Feb 18, 2021
1 parent c1483d0 commit 286eca2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions beet/toolchain/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def inject(self, cls: Callable[["Context"], InjectedType]) -> InjectedType:

@contextmanager
def activate(self):
"""Push the context directory to sys.path and handle cleanup to allow module reloading."""
sys.path.append(self._path_entry)

try:
Expand All @@ -96,6 +97,7 @@ def activate(self):

@contextmanager
def override(self, **meta: Any):
"""Temporarily update the context meta."""
to_restore = {}
to_remove = set()

Expand Down

0 comments on commit 286eca2

Please sign in to comment.