| 
    HWRF
    trunk@4391
    
   | 
 
This subclass of TempDir takes a directory name, instead of generating one automatically. More...
This subclass of TempDir takes a directory name, instead of generating one automatically.
By default, it will NOT delete the directory upon exit. That can be overridden by specifying keep=False.
  
 Public Member Functions | |
| def | __init__ | 
| Create a NamedDir for the specified directory.  More... | |
| def | name_make_dir (self) | 
| Replacement for the TempDir.name_make_dir.  More... | |
  Public Member Functions inherited from produtil.cd.TempDir | |
| def | __init__ | 
| Creates a TempDir.  More... | |
| def | name_make_dir (self) | 
| Decide the name of the directory, and create the directory.  More... | |
| def | mkdir_cd (self) | 
| Creates the temporary directory and chdirs the current process into that directory.  More... | |
| def | cd_out (self) | 
| Exit the temporary directory created by mkdir_cd and return to the original directory, if possible.  More... | |
| def | cd_rmdir (self) | 
| CD out and remove the old directory.  More... | |
| def | exception_info (self) | 
| Called to dump information to a log, or failing that, the terminal if an unexpected exception is caught.  More... | |
| def | __enter__ (self) | 
| This is a simple wrapper around mkdir_cd that is intended to be used with in a "with" block.  More... | |
| def | __exit__ (self, etype, value, traceback) | 
| Exit the 'with' block.  More... | |
Public Attributes | |
| dirname | |
| The directory name specified in the constructor.  More... | |
  Public Attributes inherited from produtil.cd.TempDir | |
| dirname | |
| The name of the target directory.  More... | |
| suffix | |
| Temporary directory name suffix.  | |
| prefix | |
| Temporary directory name prefix.  | |
| print_on_exception | |
| Should we print exceptions before exiting the directory?  | |
| dir | |
| The directory object.  More... | |
| olddir | |
| The name of the directory we came from.  More... | |
| def produtil.cd.NamedDir.__init__ | ( | self, | |
| dirname, | |||
keep = True,  | 
        |||
logger = None,  | 
        |||
keep_on_error = True,  | 
        |||
add_perms = 0,  | 
        |||
remove_perms = 0,  | 
        |||
rm_first = False  | 
        |||
| ) | 
Create a NamedDir for the specified directory.
The given logger is used to log messages. There are two deletion vs. non-deletion options:
| dirname | The directory name | 
| keep | If False, the file is deleted upon successful return of the "with" block. If True, the file is kept upon successful return. | 
| logger | A logging.logger for log messages | 
| add_perms | Permissions to add to the directory after cding into it. Default: none. | 
| remove_perms | Permissions to remove from the directory after cding into it. Default: none. | 
| keep_on_error | Controls deletion upon catching of an Exception or GeneratorException (or subclass thereof). | 
| rm_first | If the directory already exists, delete it first and make a new one before cding to it. | 
| def produtil.cd.NamedDir.name_make_dir | ( | self | ) | 
Replacement for the TempDir.name_make_dir.
Uses the directory name specified in the constructor.
| produtil.cd.NamedDir.dirname | 
 1.8.10