예제 #1
0
파일: tmpstuff.py 프로젝트: DC23/plumbing
 def __new__(cls, path=None, content=None, **kwargs):
     handle = open(path, 'w') if path else tempfile.NamedTemporaryFile(delete=False, **kwargs)
     if content: handle.write(content)
     handle.close()
     return FilePath.__new__(cls, handle.name)
예제 #2
0
파일: tmpstuff.py 프로젝트: tarah28/seqenv
 def __new__(cls, path=None, content=None, **kwargs):
     handle = open(path, 'w') if path else tempfile.NamedTemporaryFile(delete=False, **kwargs)
     if content: handle.write(content)
     handle.close()
     return FilePath.__new__(cls, handle.name)