Gaudi Framework, version v23r5

Home   Generated: Wed Nov 28 2012
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Functions | Variables
EnvConfig.TestEnvOps Namespace Reference

Classes

class  TempDir
 
class  Test
 

Functions

def buildDir
 

Variables

 saved_processors Variable.processors
 

Detailed Description

Created on Jul 12, 2011

@author: mplajner

Function Documentation

def EnvConfig.TestEnvOps.buildDir (   files,
  rootdir = os.curdir 
)
Create a directory structure from the content of files.

@param files: a dictionary or list of pairs mapping a filename to the content
              if the content is a dictionary, recurse
@param rootdir: base directory

Definition at line 20 of file TestEnvOps.py.

20 
21 def buildDir(files, rootdir=os.curdir):
22  '''
23  Create a directory structure from the content of files.
24 
25  @param files: a dictionary or list of pairs mapping a filename to the content
26  if the content is a dictionary, recurse
27  @param rootdir: base directory
28  '''
29  if type(files) is dict:
30  files = files.items()
31 
32  # ensure that the root exists (to allow empty directories)
33  if not os.path.exists(rootdir):
34  os.makedirs(rootdir)
35 
36  # create all the entries
37  for filename, data in files:
38  filename = os.path.join(rootdir, filename)
39  if type(data) is dict:
40  buildDir(data, filename)
41  else:
42  d = os.path.dirname(filename)
43  if not os.path.exists(d):
44  os.makedirs(d)
45  f = open(filename, "w")
46  if data:
47  f.write(data)
48  f.close()

Variable Documentation

EnvConfig.TestEnvOps.saved_processors Variable.processors

Definition at line 15 of file TestEnvOps.py.


Generated at Wed Nov 28 2012 12:17:35 for Gaudi Framework, version v23r5 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004