1 """Hardcoded values"""
2
3 from os import path,makedirs,environ
4
5 _pyFoamDirName="pyFoam"
6
7 _pyFoamConfigName="pyfoamrc"
8
10 """@return: the global directory"""
11 return path.join("/etc",_pyFoamDirName)
12
16
18 """@return: the user directory"""
19 return path.expanduser(path.join("~","."+_pyFoamDirName))
20
24
31
33 """Path to the log directory that this user may write to.
34 /var/log/pyFoam for root, ~/.pyFoam/log for all others
35 @return: path to the log directory."""
36 if userName()=="root":
37 return path.join("/var/log","pyFoam")
38 else:
39 return path.join(userDirectory(),"log")
40
42 """Makes sure that the directory exists
43 @param name: the directory"""
44 if path.exists(name):
45 return
46 else:
47 makedirs(name,mode=0755)
48