class documentation

class InfolderGoneWithTheWind:

Constructor: InfolderGoneWithTheWind(prefix)

View In Hierarchy

with InfolderGoneWithTheWind(): ... executes the block in a

temporary folder under the current folder. The temporary folder is deleted on exiting the block.

CAVEAT: copy-pasted to toolsdivers

>>> import os
>>> dir_ = os.getcwd()  # for the record
>>> len_ = len(os.listdir('.'))
>>> with InfolderGoneWithTheWind():  # doctest: +SKIP
...     # do some work in a folder here, e.g. write files
...     len(dir_) > len(os.getcwd()) and os.getcwd() in dir_
True
>>> # magically we are back in the original folder
>>> assert dir_ == os.getcwd()
>>> assert len(os.listdir('.')) == len_
Method __enter__ Undocumented
Method __exit__ Undocumented
Method __init__ no folder needs to be given
Instance Variable prefix Undocumented
Instance Variable root_dir Undocumented
Instance Variable target_dir Undocumented
Instance Variable _target_dir Undocumented
def __enter__(self):

Undocumented

def __exit__(self, *args):

Undocumented

def __init__(self, prefix='_'):

no folder needs to be given

prefix =

Undocumented

root_dir =

Undocumented

target_dir =

Undocumented

_target_dir =

Undocumented