TemporaryDirectoryChange

digraph InheritanceGraph { graph [bgcolor=transparent, color=lightsteelblue2, fontname=Arial, fontsize=10, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, splines=spline, style="dashed, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=10, height=0, penwidth=2, shape=box, style="filled, rounded", width=0]; edge [color=lightslategrey, penwidth=1]; subgraph "cluster_abjad.system" { graph [label="abjad.system"]; node [color=1]; "abjad.system.AbjadObject.AbjadObject" [URL="../api/abjad/system/AbjadObject.html#abjad.system.AbjadObject.AbjadObject", label="Abjad\nObject", target=_top]; "abjad.system.ContextManager.ContextManager" [URL="../api/abjad/system/ContextManager.html#abjad.system.ContextManager.ContextManager", label="Context\nManager", shape=oval, style=bold, target=_top]; "abjad.system.TemporaryDirectoryChange.TemporaryDirectoryChange" [URL="../api/abjad/system/TemporaryDirectoryChange.html#abjad.system.TemporaryDirectoryChange.TemporaryDirectoryChange", color=black, fontcolor=white, label="Temporary\nDirectory\nChange", target=_top]; "abjad.system.AbjadObject.AbjadObject" -> "abjad.system.ContextManager.ContextManager"; "abjad.system.ContextManager.ContextManager" -> "abjad.system.TemporaryDirectoryChange.TemporaryDirectoryChange"; } subgraph cluster_builtins { graph [label=builtins]; node [color=2]; "builtins.object" [URL="https://docs.python.org/3.6/library/functions.html#object", label=object, target=_top]; } "builtins.object" -> "abjad.system.AbjadObject.AbjadObject"; }

class abjad.system.TemporaryDirectoryChange.TemporaryDirectoryChange(directory=None, verbose=None)

A context manager for temporarily changing the current working directory.


Attributes Summary

__enter__ Enters context manager and changes to directory.
__exit__ Exits context manager and returns to original working directory.
__repr__ Gets interpreter representation of context manager.
directory Gets temporary directory of context manager.
original_directory Gets original directory of context manager.
verbose Is true if context manager prints verbose messages on entrance and exit.

Special methods

__enter__()

Enters context manager and changes to directory.

__exit__(exc_type, exc_value, traceback)

Exits context manager and returns to original working directory.

(AbjadObject).__format__(format_specification='')

Formats Abjad object.

Set format_specification to '' or 'storage'. Interprets '' equal to 'storage'.

Returns string.

__repr__()

Gets interpreter representation of context manager.

Returns string.


Read-only properties

directory

Gets temporary directory of context manager.

Returns string.

original_directory

Gets original directory of context manager.

Returns string.

verbose

Is true if context manager prints verbose messages on entrance and exit.

Returns true or false.