Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
utils.chdir Class Reference
Inheritance diagram for utils.chdir:

Public Member Functions

def __init__ (self, d)
 
def __enter__ (self)
 
def __exit__ (self, t, v, tb)
 

Detailed Description

Helper class used for changing into and out of a directory.

Definition at line 62 of file utils.py.

Constructor & Destructor Documentation

◆ __init__()

def utils.chdir.__init__ (   self,
  d 
)

Definition at line 64 of file utils.py.

64 def __init__(self, d):
65 self._dir = d
66 self._orig_dir = None
67

Member Function Documentation

◆ __enter__()

def utils.chdir.__enter__ (   self)

Definition at line 68 of file utils.py.

68 def __enter__(self):
69 self._orig_dir = os.getcwd()
70 os.chdir(self._dir)
71 return self
72

◆ __exit__()

def utils.chdir.__exit__ (   self,
  t,
  v,
  tb 
)

Definition at line 73 of file utils.py.

73 def __exit__(self, t, v, tb):
74 os.chdir(self._orig_dir)
75
76

The documentation for this class was generated from the following file: