Home | Trees | Indices | Help |
---|
|
1 ######################################################################## 2 # 3 # File: temporary.py 4 # Author: Alex Samuel 5 # Date: 2001-04-06 6 # 7 # Contents: 8 # Resource classes to manage temporary files and directories. 9 # 10 # Copyright (c) 2001, 2002, 2003 by CodeSourcery, LLC. All rights reserved. 11 # 12 # For license terms see the file COPYING. 13 # 14 ######################################################################## 15 16 ######################################################################## 17 # imports 18 ######################################################################## 19 20 import os 21 import qm.common 22 import qm.fields 23 from qm.test.result import * 24 from qm.test.test import * 25 from qm.test.resource import * 26 import qm.temporary_directory 27 28 ######################################################################## 29 # classes 30 ######################################################################## 3133 """Resource class to manage a temporary directory. 34 35 An instance of this resource creates a temporary directory during 36 setup, and deletes it during cleanup. The full path to the 37 directory is available to tests via a context property.""" 38 39 arguments = [ 40 qm.fields.TextField( 41 name="dir_path_property", 42 title="Directory Path Property Name", 43 description="The name of the context property which is " 44 "set to the path to the temporary directory.", 45 default_value="temp_dir_path" 46 ), 47 48 qm.fields.IntegerField( 49 name="delete_recursively", 50 title="Delete Directory Recursively", 51 description="""This field is obsolete All temporary 52 directories are removed recursively.""", 53 default_value=1, 54 ), 55 ] 56 5768 69 70 ######################################################################## 71 # Local Variables: 72 # mode: python 73 # indent-tabs-mode: nil 74 # fill-column: 72 75 # End: 7659 60 # Generate a temporary file name. 61 self.__dir = qm.temporary_directory.TemporaryDirectory() 62 context[self.dir_path_property] = self.__dir.GetPath()63 64
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Fri Dec 23 12:30:45 2011 | http://epydoc.sourceforge.net |