Package schrodinger :: Package utils :: Module fileutils :: Class tempfilename
[hide private]
[frames] | no frames]

Class tempfilename

object --+        
         |        
basestring --+    
             |    
       unicode --+
                 |
                tempfilename

Instance Methods [hide private]
 
__enter__(self)
 
__exit__(self, exc_type, exc_value, traceback)
 
remove(self)

Inherited from unicode: __add__, __contains__, __eq__, __format__, __ge__, __getattribute__, __getitem__, __getnewargs__, __getslice__, __gt__, __hash__, __le__, __len__, __lt__, __mod__, __mul__, __ne__, __repr__, __rmod__, __rmul__, __sizeof__, __str__, capitalize, center, count, decode, encode, endswith, expandtabs, find, format, index, isalnum, isalpha, isdecimal, isdigit, islower, isnumeric, isspace, istitle, isupper, join, ljust, lower, lstrip, partition, replace, rfind, rindex, rjust, rpartition, rsplit, rstrip, split, splitlines, startswith, strip, swapcase, title, translate, upper, zfill

Inherited from unicode (private): _formatter_field_name_split, _formatter_parser

Inherited from object: __delattr__, __init__, __reduce__, __reduce_ex__, __setattr__, __subclasshook__

Static Methods [hide private]
a new object with type S, a subtype of T
__new__(cls, prefix, suffix, temp_dir=None)
A thread-safe replacement for tempfile.mktemp.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__new__(cls, prefix, suffix, temp_dir=None)
Static Method

 

A thread-safe replacement for tempfile.mktemp. Creates a temporary file with the given prefix, suffix, and directory and returns its filename. Calling remove will remove the file. Can be used as a context manager, which will remove the file automatically on exit.

Parameters:
  • prefix (str) - Filename prefix
  • suffix (str) - Filename suffix
  • temp_dir (str or None.) - Filename directory path. Defaults to the schrodinger temp directory.
Returns: a new object with type S, a subtype of T
The name of the file descriptor, wrapped in a context manager that will remove the file on exit.
Overrides: object.__new__