Gaudi Framework, version v24r2

Home   Generated: Wed Dec 4 2013
 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 21 of file TestEnvOps.py.

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

Variable Documentation

EnvConfig.TestEnvOps.saved_processors Variable.processors

Definition at line 16 of file TestEnvOps.py.


Generated at Wed Dec 4 2013 14:33:20 for Gaudi Framework, version v24r2 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004