Changeset 1163


Ignore:
Timestamp:
03/17/09 11:12:07 (5 years ago)
Author:
wehart
Message:

Generalizing the API for the TempfileManager?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pyutilib/plugin/config/tempfiles.py

    r1148 r1163  
    4444        declare_option("tempdir", default=None) 
    4545 
    46     def create_tempfile(self, suffix=None, prefix=None, text=False): 
     46    def create_tempfile(self, suffix=None, prefix=None, text=False, dir=None): 
    4747        """ 
    4848        Return the absolute path of a temporary filename that is  
     
    5454        if prefix is None: 
    5555            prefix='tmp' 
    56         ans = tempfile.mkstemp(suffix=suffix, prefix=prefix, text=text, dir=self.tempdir) 
     56        if dir is None: 
     57            dir=self.tempdir 
     58        ans = tempfile.mkstemp(suffix=suffix, prefix=prefix, text=text, dir=dir) 
    5759        self._tempfiles.append(ans[1]) 
    5860        os.close(ans[0]) 
Note: See TracChangeset for help on using the changeset viewer.