HWRF  trunk@4391
Classes | Variables
produtil.cd Namespace Reference

Change directory, handle temporary directories. More...

Detailed Description

Change directory, handle temporary directories.

This module provides a means by which to change to a different directory in a Python "with" block and change back out afterwards, regardless of what happens inside the block. It can, optionally, create a new directory, and optionally delete it at the end of the block. There are two classes:

Classes

class  NamedDir
 This subclass of TempDir takes a directory name, instead of generating one automatically. More...
 
class  TempDir
 This class is intended to be used with the Python "with TempDir() as t" syntax. More...
 

Variables

list __all__ = ['TempDir','NamedDir','perm_remove','perm_add']
 List of symbols to export by "from produtil.cd import *".
 
 perm_add = stat.S_IRUSR|stat.S_IWUSR|stat.S_IXUSR|\
 Default permissions to add to new directories created by TempDir: user has all possible access. More...
 
 perm_remove = stat.S_IWOTH|stat.S_ISUID
 Permissions to remove from all directories: world write and setuid. More...
 

Variable Documentation

produtil.cd.perm_add = stat.S_IRUSR|stat.S_IWUSR|stat.S_IXUSR|\

Default permissions to add to new directories created by TempDir: user has all possible access.

Group and other can read and execute.

Definition at line 29 of file cd.py.

produtil.cd.perm_remove = stat.S_IWOTH|stat.S_ISUID

Permissions to remove from all directories: world write and setuid.

This overrides perm_add.

Definition at line 36 of file cd.py.