OpenQuizz
Une application de gestion des contenus pédagogiques
TempDirectory Class Reference
Inheritance diagram for TempDirectory:

Public Member Functions

def __init__ (self, path=None, delete=_default, kind="temp", globally_managed=False)
 
def path (self)
 
def __repr__ (self)
 
def __enter__ (self)
 
def __exit__ (self, exc, value, tb)
 
def cleanup (self)
 

Data Fields

 delete
 
 kind
 

Detailed Description

Helper class that owns and cleans up a temporary directory.

This class can be used as a context manager or as an OO representation of a
temporary directory.

Attributes:
    path
        Location to the created temporary directory
    delete
        Whether the directory should be deleted when exiting
        (when used as a contextmanager)

Methods:
    cleanup()
        Deletes the temporary directory

When used as a context manager, if the delete attribute is True, on
exiting the context the temporary directory is deleted.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  path = None,
  delete = _default,
  kind = "temp",
  globally_managed = False 
)

Member Function Documentation

◆ __enter__()

def __enter__ (   self)

◆ __exit__()

def __exit__ (   self,
  exc,
  value,
  tb 
)

◆ __repr__()

def __repr__ (   self)

◆ cleanup()

def cleanup (   self)
Remove the temporary directory created and reset state

◆ path()

def path (   self)

Field Documentation

◆ delete

delete

◆ kind

kind

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