1
2 """Hardcoded values"""
3
4 from os import path,makedirs,environ
5 from PyFoam.ThirdParty.six import PY3
6
7 _pyFoamDirName="pyFoam"
8
9 _pyFoamConfigName="pyfoamrc"
10
14
18
20 """@return: The name of the global configuration directory where .cfg-files can be placed"""
21 return globalConfigFile()+".d"
22
26
30
32 """@return: The name of the user configuration directory where .cfg-files can be placed"""
33 return userConfigFile()+".d"
34
41
43 """Path to the log directory that this user may write to.
44 /var/log/pyFoam for root, ~/.pyFoam/log for all others
45 @return: path to the log directory."""
46 if userName()=="root":
47 return path.join("/var/log","pyFoam")
48 else:
49 return path.join(userDirectory(),"log")
50
52 """Makes sure that the directory exists
53 @param name: the directory"""
54 if path.exists(name):
55 return
56 else:
57 if PY3:
58 perm=eval("0o755")
59 else:
60 perm=eval("0755")
61
62 makedirs(name,mode=perm)
63
64
65