From 4d2c2ac7f8ba77294a29e37c30f01734e6d3a848 Mon Sep 17 00:00:00 2001 From: "Zooko O'Whielacronx zooko@zooko.com" <zooko@zooko.com> Date: Mon, 4 Jun 2007 17:14:44 +0530 Subject: [PATCH] zfec: update doc strings in fileutil darcs-hash:458b9a2206a8f02106db5d6bdd2b9ab62b225e7b --- zfec/zfec/util/fileutil.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/zfec/zfec/util/fileutil.py b/zfec/zfec/util/fileutil.py index 79d9859..147ecbf 100644 --- a/zfec/zfec/util/fileutil.py +++ b/zfec/zfec/util/fileutil.py @@ -96,7 +96,7 @@ class _Dir(object): Create a subdirectory in the tempdir and remember it so as to call shutdown() on it before attempting to clean up. - @rtype: NamedTemporaryDirectory instance + @rtype: _Dir instance """ ffn = os.path.join(self.name, dirname) sd = _Dir(ffn, self.cleanup) @@ -143,12 +143,12 @@ class NamedTemporaryDirectory(_Dir): Call tempfile.mkdtemp(), store the name of the dir in self.name, and rm_dir() when it gets garbage collected or "shutdown()". - Also optionally keep track of file objects for files within the tempdir - and call close() on them before rm_dir(). This is a convenient way to - open temp files within the directory, and it is very helpful on Windows - because you can't delete a directory which contains a file which is - currently open. + Also keep track of file objects for files within the tempdir and call + close() on them before rm_dir(). This is a convenient way to open temp + files within the directory, and it is very helpful on Windows because you + can't delete a directory which contains a file which is currently open. """ + def __init__(self, cleanup=True, *args, **kwargs): """ If cleanup, then the directory will be rmrf'ed when the object is shutdown. """ name = tempfile.mkdtemp(*args, **kwargs) -- 2.45.2